Summary: Defaulted (*=default*ed) default constructors are better
because they can be constexpr and/or noexcept when C++ Standard
thinks it is right to do so. And they remain user-declared rather
than user-provided. Regarding *=default*ed default constructor,
benifit is that the work might be done during compilation and we
might not need to worry about exception paths. And for destructors,
apart from that that =defaulted definition is in sync with defaulted
default constructor we might discover that in some cases "() {}" might
be ill-formed when "= default;" compiltion indicates so. If =defaulted
definition for destructor doesn't do any harm then why not go for it.
Closes #216
Reviewed By: @yfeldblum
Differential Revision:
D2145322
Pulled By: @sgolemon
53 files changed:
- Block() { }
- ~Block() { }
+ Block() = default;
+ ~Block() = default;
} __attribute__((__aligned__));
// This should be alignas(std::max_align_t) but neither alignas nor
// max_align_t are supported by gcc 4.6.2.
} __attribute__((__aligned__));
// This should be alignas(std::max_align_t) but neither alignas nor
// max_align_t are supported by gcc 4.6.2.
struct SimpleRetT { size_t idx; bool success;
SimpleRetT(size_t i, bool s) : idx(i), success(s) {}
struct SimpleRetT { size_t idx; bool success;
SimpleRetT(size_t i, bool s) : idx(i), success(s) {}
+ SimpleRetT() = default;
AtomicHashArray(size_t capacity, KeyT emptyKey, KeyT lockedKey,
KeyT erasedKey, double maxLoadFactor, size_t cacheSize);
AtomicHashArray(size_t capacity, KeyT emptyKey, KeyT lockedKey,
KeyT erasedKey, double maxLoadFactor, size_t cacheSize);
+ ~AtomicHashArray() = default;
inline void unlockCell(value_type* const cell, KeyT newKey) {
cellKeyPtr(*cell)->store(newKey, std::memory_order_release);
inline void unlockCell(value_type* const cell, KeyT newKey) {
cellKeyPtr(*cell)->store(newKey, std::memory_order_release);
struct SimpleRetT { uint32_t i; size_t j; bool success;
SimpleRetT(uint32_t ii, size_t jj, bool s) : i(ii), j(jj), success(s) {}
struct SimpleRetT { uint32_t i; size_t j; bool success;
SimpleRetT(uint32_t ii, size_t jj, bool s) : i(ii), j(jj), success(s) {}
+ SimpleRetT() = default;
template<>
class try_and_catch<> : public exception_wrapper {
public:
template<>
class try_and_catch<> : public exception_wrapper {
public:
+ try_and_catch() = default;
protected:
template <typename F>
protected:
template <typename F>
typedef GroupVarint<T> Base;
typedef T type;
typedef GroupVarint<T> Base;
typedef T type;
- GroupVarintDecoder() { }
+ GroupVarintDecoder() = default;
explicit GroupVarintDecoder(StringPiece data,
size_t maxCount = (size_t)-1)
explicit GroupVarintDecoder(StringPiece data,
size_t maxCount = (size_t)-1)
* Default-construct pipeline. Useful to move-assign later,
* just like MPMCQueue, see MPMCQueue.h for more details.
*/
* Default-construct pipeline. Useful to move-assign later,
* just like MPMCQueue, see MPMCQueue.h for more details.
*/
+ MPMCPipeline() = default;
/**
* Construct a pipeline with N+1 queue sizes.
/**
* Construct a pipeline with N+1 queue sizes.
* likely become inaccessible) when the MemoryMapping object is destroyed.
*/
struct Options {
* likely become inaccessible) when the MemoryMapping object is destroyed.
*/
struct Options {
// Convenience methods; return *this for chaining.
Options& setPageSize(off_t v) { pageSize = v; return *this; }
// Convenience methods; return *this for chaining.
Options& setPageSize(off_t v) { pageSize = v; return *this; }
// SingletonHolders.
class SingletonHolderBase {
public:
// SingletonHolders.
class SingletonHolderBase {
public:
- virtual ~SingletonHolderBase() {}
+ virtual ~SingletonHolderBase() = default;
virtual TypeDescriptor type() = 0;
virtual bool hasLiveInstance() = 0;
virtual TypeDescriptor type() = 0;
virtual bool hasLiveInstance() = 0;
private:
struct PaddedSpinLock {
private:
struct PaddedSpinLock {
- PaddedSpinLock() : lock() { }
+ PaddedSpinLock() : lock() {}
T lock;
char padding[FOLLY_CACHE_LINE_SIZE - sizeof(T)];
};
T lock;
char padding[FOLLY_CACHE_LINE_SIZE - sizeof(T)];
};
class SocketAddress {
public:
class SocketAddress {
public:
+ SocketAddress() = default;
/**
* Construct a SocketAddress from a hostname and port.
/**
* Construct a SocketAddress from a hostname and port.
class CalledProcessError : public SubprocessError {
public:
explicit CalledProcessError(ProcessReturnCode rc);
class CalledProcessError : public SubprocessError {
public:
explicit CalledProcessError(ProcessReturnCode rc);
- ~CalledProcessError() throw() { }
+ ~CalledProcessError() throw() = default;
const char* what() const throw() FOLLY_OVERRIDE { return what_.c_str(); }
ProcessReturnCode returnCode() const { return returnCode_; }
private:
const char* what() const throw() FOLLY_OVERRIDE { return what_.c_str(); }
ProcessReturnCode returnCode() const { return returnCode_; }
private:
class SubprocessSpawnError : public SubprocessError {
public:
SubprocessSpawnError(const char* executable, int errCode, int errnoValue);
class SubprocessSpawnError : public SubprocessError {
public:
SubprocessSpawnError(const char* executable, int errCode, int errnoValue);
- ~SubprocessSpawnError() throw() {}
+ ~SubprocessSpawnError() throw() = default;
const char* what() const throw() FOLLY_OVERRIDE { return what_.c_str(); }
int errnoValue() const { return errnoValue_; }
const char* what() const throw() FOLLY_OVERRIDE { return what_.c_str(); }
int errnoValue() const { return errnoValue_; }
template<class T, class Tag=void>
class ThreadLocal {
public:
template<class T, class Tag=void>
class ThreadLocal {
public:
+ ThreadLocal() = default;
T* get() const {
T* ptr = tlp_.get();
T* get() const {
T* ptr = tlp_.get();
-TypeError::~TypeError() {}
+TypeError::~TypeError() = default;
// This is a higher-order preprocessor macro to aid going from runtime
// types to the compile time type system.
// This is a higher-order preprocessor macro to aid going from runtime
// types to the compile time type system.
struct ValidationContext;
struct IValidator {
struct ValidationContext;
struct IValidator {
- virtual ~IValidator() {}
+ virtual ~IValidator() = default;
private:
friend struct ValidationContext;
private:
friend struct ValidationContext;
* Root validator for a schema.
*/
struct SchemaValidator final : IValidator, public Validator {
* Root validator for a schema.
*/
struct SchemaValidator final : IValidator, public Validator {
+ SchemaValidator() = default;
void loadSchema(SchemaValidatorContext& context, const dynamic& schema);
Optional<SchemaError> validate(ValidationContext&,
void loadSchema(SchemaValidatorContext& context, const dynamic& schema);
Optional<SchemaError> validate(ValidationContext&,
-Validator::~Validator() {}
+Validator::~Validator() = default;
std::unique_ptr<Validator> makeValidator(const dynamic& schema) {
auto v = make_unique<SchemaValidator>();
std::unique_ptr<Validator> makeValidator(const dynamic& schema) {
auto v = make_unique<SchemaValidator>();
typedef typename Base::size_type size_type;
typedef typename Base::difference_type difference_type;
typedef typename Base::size_type size_type;
typedef typename Base::difference_type difference_type;
- explicit StringKeyedUnorderedMap() {}
+ explicit StringKeyedUnorderedMap() = default;
explicit StringKeyedUnorderedMap(
size_type n,
explicit StringKeyedUnorderedMap(
size_type n,
RangeSource<Iterator>> {
Range<Iterator> range_;
public:
RangeSource<Iterator>> {
Range<Iterator> range_;
public:
+ RangeSource() = default;
explicit RangeSource(Range<Iterator> range)
: range_(std::move(range))
{}
explicit RangeSource(Range<Iterator> range)
: range_(std::move(range))
{}
class Map : public Operator<Map<Predicate>> {
Predicate pred_;
public:
class Map : public Operator<Map<Predicate>> {
Predicate pred_;
public:
explicit Map(Predicate pred)
: pred_(std::move(pred))
explicit Map(Predicate pred)
: pred_(std::move(pred))
class Filter : public Operator<Filter<Predicate>> {
Predicate pred_;
public:
class Filter : public Operator<Filter<Predicate>> {
Predicate pred_;
public:
explicit Filter(Predicate pred)
: pred_(std::move(pred))
{ }
explicit Filter(Predicate pred)
: pred_(std::move(pred))
{ }
class Until : public Operator<Until<Predicate>> {
Predicate pred_;
public:
class Until : public Operator<Until<Predicate>> {
Predicate pred_;
public:
explicit Until(Predicate pred)
: pred_(std::move(pred))
{}
explicit Until(Predicate pred)
: pred_(std::move(pred))
{}
Selector selector_;
Comparer comparer_;
public:
Selector selector_;
Comparer comparer_;
public:
explicit Order(Selector selector)
: selector_(std::move(selector))
explicit Order(Selector selector)
: selector_(std::move(selector))
class Distinct : public Operator<Distinct<Selector>> {
Selector selector_;
public:
class Distinct : public Operator<Distinct<Selector>> {
Selector selector_;
public:
explicit Distinct(Selector selector)
: selector_(std::move(selector))
explicit Distinct(Selector selector)
: selector_(std::move(selector))
Seed seed_;
Fold fold_;
public:
Seed seed_;
Fold fold_;
public:
FoldLeft(Seed seed,
Fold fold)
: seed_(std::move(seed))
FoldLeft(Seed seed,
Fold fold)
: seed_(std::move(seed))
*/
class First : public Operator<First> {
public:
*/
class First : public Operator<First> {
public:
template<class Source,
class Value,
template<class Source,
class Value,
*/
class Any : public Operator<Any> {
public:
*/
class Any : public Operator<Any> {
public:
template<class Source,
class Value>
template<class Source,
class Value>
class All : public Operator<All<Predicate>> {
Predicate pred_;
public:
class All : public Operator<All<Predicate>> {
Predicate pred_;
public:
explicit All(Predicate pred)
: pred_(std::move(pred))
{ }
explicit All(Predicate pred)
: pred_(std::move(pred))
{ }
class Reduce : public Operator<Reduce<Reducer>> {
Reducer reducer_;
public:
class Reduce : public Operator<Reduce<Reducer>> {
Reducer reducer_;
public:
explicit Reduce(Reducer reducer)
: reducer_(std::move(reducer))
{}
explicit Reduce(Reducer reducer)
: reducer_(std::move(reducer))
{}
*/
class Count : public Operator<Count> {
public:
*/
class Count : public Operator<Count> {
public:
template<class Source,
class Value>
template<class Source,
class Value>
Selector selector_;
Comparer comparer_;
public:
Selector selector_;
Comparer comparer_;
public:
explicit Min(Selector selector)
: selector_(std::move(selector))
explicit Min(Selector selector)
: selector_(std::move(selector))
template<class Collection>
class Collect : public Operator<Collect<Collection>> {
public:
template<class Collection>
class Collect : public Operator<Collect<Collection>> {
public:
template<class Value,
class Source,
template<class Value,
class Source,
template<class> class Allocator>
class CollectTemplate : public Operator<CollectTemplate<Container, Allocator>> {
public:
template<class> class Allocator>
class CollectTemplate : public Operator<CollectTemplate<Container, Allocator>> {
public:
+ CollectTemplate() = default;
template<class Value,
class Source,
template<class Value,
class Source,
*/
class Concat : public Operator<Concat> {
public:
*/
class Concat : public Operator<Concat> {
public:
template<class Inner,
class Source,
template<class Inner,
class Source,
*/
class RangeConcat : public Operator<RangeConcat> {
public:
*/
class RangeConcat : public Operator<RangeConcat> {
public:
+ RangeConcat() = default;
template<class Range,
class Source,
template<class Range,
class Source,
*/
class Dereference : public Operator<Dereference> {
public:
*/
class Dereference : public Operator<Dereference> {
public:
+ Dereference() = default;
template<class Value,
class Source,
template<class Value,
class Source,
*/
class Indirect : public Operator<Indirect> {
public:
*/
class Indirect : public Operator<Indirect> {
public:
template <class Value,
class Source,
template <class Value,
class Source,
* non-template operators, statically defined to avoid the need for anything but
* the header.
*/
* non-template operators, statically defined to avoid the need for anything but
* the header.
*/
-static const detail::Sum sum;
+static const detail::Sum sum{};
-static const detail::Count count;
+static const detail::Count count{};
-static const detail::First first;
+static const detail::First first{};
/**
* Use directly for detecting any values, or as a function to detect values
/**
* Use directly for detecting any values, or as a function to detect values
* auto nonempty = g | any;
* auto evens = g | any(even);
*/
* auto nonempty = g | any;
* auto evens = g | any(even);
*/
-static const detail::Any any;
+static const detail::Any any{};
-static const detail::Min<Identity, Less> min;
+static const detail::Min<Identity, Less> min{};
-static const detail::Min<Identity, Greater> max;
+static const detail::Min<Identity, Greater> max{};
-static const detail::Order<Identity> order;
+static const detail::Order<Identity> order{};
-static const detail::Distinct<Identity> distinct;
+static const detail::Distinct<Identity> distinct{};
-static const detail::Map<Move> move;
+static const detail::Map<Move> move{};
-static const detail::Concat concat;
+static const detail::Concat concat{};
-static const detail::RangeConcat rconcat;
+static const detail::RangeConcat rconcat{};
/**
* Use directly for infinite sequences, or as a function to limit cycle count.
/**
* Use directly for infinite sequences, or as a function to limit cycle count.
* auto forever = g | cycle;
* auto thrice = g | cycle(3);
*/
* auto forever = g | cycle;
* auto thrice = g | cycle(3);
*/
-static const detail::Cycle cycle;
+static const detail::Cycle cycle{};
-static const detail::Dereference dereference;
+static const detail::Dereference dereference{};
-static const detail::Indirect indirect;
+static const detail::Indirect indirect{};
inline detail::Take take(size_t count) {
return detail::Take(count);
inline detail::Take take(size_t count) {
return detail::Take(count);
-static const detail::Map<detail::MergeTuples> tuple_flatten;
+static const detail::Map<detail::MergeTuples> tuple_flatten{};
// TODO(mcurtiss): support zip() for N>1 operands. Because of variadic problems,
// this might not be easily possible until gcc4.8 is available.
// TODO(mcurtiss): support zip() for N>1 operands. Because of variadic problems,
// this might not be easily possible until gcc4.8 is available.
First first_;
Second second_;
public:
First first_;
Second second_;
public:
Composed(First first, Second second)
: first_(std::move(first))
Composed(First first, Second second)
: first_(std::move(first))
Range<Iterator> range_;
public:
Range<Iterator> range_;
public:
- ChunkedRangeSource() {}
+ ChunkedRangeSource() = default;
ChunkedRangeSource(int chunkSize, Range<Iterator> range)
: chunkSize_(chunkSize), range_(std::move(range)) {}
ChunkedRangeSource(int chunkSize, Range<Iterator> range)
: chunkSize_(chunkSize), range_(std::move(range)) {}
Predicate pred_;
size_t nThreads_;
public:
Predicate pred_;
size_t nThreads_;
public:
PMap(Predicate pred, size_t nThreads)
: pred_(std::move(pred)),
PMap(Predicate pred, size_t nThreads)
: pred_(std::move(pred)),
class HandshakeCB {
public:
class HandshakeCB {
public:
- virtual ~HandshakeCB() {}
+ virtual ~HandshakeCB() = default;
/**
* handshakeVer() is invoked during handshaking to give the
/**
* handshakeVer() is invoked during handshaking to give the
class AcceptCallback {
public:
class AcceptCallback {
public:
- virtual ~AcceptCallback() {}
+ virtual ~AcceptCallback() = default;
/**
* connectionAccepted() is called whenever a new client connection is
/**
* connectionAccepted() is called whenever a new client connection is
explicit RemoteAcceptor(AcceptCallback *callback)
: callback_(callback) {}
explicit RemoteAcceptor(AcceptCallback *callback)
: callback_(callback) {}
+ ~RemoteAcceptor() = default;
void start(EventBase *eventBase, uint32_t maxAtOnce, uint32_t maxInQueue);
void stop(EventBase* eventBase, AcceptCallback* callback);
void start(EventBase *eventBase, uint32_t maxAtOnce, uint32_t maxInQueue);
void stop(EventBase* eventBase, AcceptCallback* callback);
}
// private destructor, to ensure callers use destroy()
}
// private destructor, to ensure callers use destroy()
- virtual ~BytesWriteRequest() {}
+ virtual ~BytesWriteRequest() = default;
const struct iovec* getOps() const {
assert(opCount_ > opIndex_);
const struct iovec* getOps() const {
assert(opCount_ > opIndex_);
class ConnectCallback {
public:
class ConnectCallback {
public:
- virtual ~ConnectCallback() {}
+ virtual ~ConnectCallback() = default;
/**
* connectSuccess() will be invoked when the connection has been
/**
* connectSuccess() will be invoked when the connection has been
virtual size_t getRawBytesReceived() const = 0;
protected:
virtual size_t getRawBytesReceived() const = 0;
protected:
- virtual ~AsyncTransport() {}
+ virtual ~AsyncTransport() = default;
};
// Transitional intermediate interface. This is deprecated.
};
// Transitional intermediate interface. This is deprecated.
class ReadCallback {
public:
class ReadCallback {
public:
- virtual ~ReadCallback() {}
+ virtual ~ReadCallback() = default;
/**
* When data becomes available, getReadBuffer() will be invoked to get the
/**
* When data becomes available, getReadBuffer() will be invoked to get the
class WriteCallback {
public:
class WriteCallback {
public:
- virtual ~WriteCallback() {}
+ virtual ~WriteCallback() = default;
/**
* writeSuccess() will be invoked when all of the data has been
/**
* writeSuccess() will be invoked when all of the data has been
std::unique_ptr<folly::IOBuf> buf,
bool truncated) noexcept = 0;
std::unique_ptr<folly::IOBuf> buf,
bool truncated) noexcept = 0;
+ virtual ~Callback() = default;
*/
virtual void onReadClosed() noexcept = 0;
*/
virtual void onReadClosed() noexcept = 0;
- virtual ~ReadCallback() {}
+ virtual ~ReadCallback() = default;
* shared_ptr using a DelayedDestruction::Destructor as the second argument
* to the shared_ptr constructor.
*/
* shared_ptr using a DelayedDestruction::Destructor as the second argument
* to the shared_ptr constructor.
*/
- virtual ~DelayedDestruction() {}
+ virtual ~DelayedDestruction() = default;
/**
* Get the number of DestructorGuards currently protecting this object.
/**
* Get the number of DestructorGuards currently protecting this object.
class EventBaseObserver {
public:
class EventBaseObserver {
public:
- virtual ~EventBaseObserver() {}
+ virtual ~EventBaseObserver() = default;
virtual uint32_t getSampleRate() const = 0;
virtual uint32_t getSampleRate() const = 0;
*/
class LoopCallback {
public:
*/
class LoopCallback {
public:
- virtual ~LoopCallback() {}
+ virtual ~LoopCallback() = default;
virtual void runLoopCallback() noexcept = 0;
void cancelLoopCallback() {
virtual void runLoopCallback() noexcept = 0;
void cancelLoopCallback() {
class RequestData {
public:
class RequestData {
public:
- virtual ~RequestData() {}
+ virtual ~RequestData() = default;
*/
class PasswordCollector {
public:
*/
class PasswordCollector {
public:
- virtual ~PasswordCollector() {}
+ virtual ~PasswordCollector() = default;
/**
* Interface for customizing how to collect private key password.
*
/**
* Interface for customizing how to collect private key password.
*
- virtual ~TimeoutManager() {}
+ virtual ~TimeoutManager() = default;
/**
* Attaches/detaches TimeoutManager to AsyncTimeout
/**
* Attaches/detaches TimeoutManager to AsyncTimeout
typedef std::reverse_iterator<iterator> reverse_iterator;
typedef std::reverse_iterator<const_iterator> const_reverse_iterator;
typedef std::reverse_iterator<iterator> reverse_iterator;
typedef std::reverse_iterator<const_iterator> const_reverse_iterator;
- explicit small_vector() {}
+ explicit small_vector() = default;
small_vector(small_vector const& o) {
auto n = o.size();
small_vector(small_vector const& o) {
auto n = o.size();
* Decrement the count of client-side connections.
*/
virtual void onConnectionRemoved() = 0;
* Decrement the count of client-side connections.
*/
virtual void onConnectionRemoved() = 0;
- virtual ~IConnectionCounter() {}
+ virtual ~IConnectionCounter() = default;
};
class SimpleConnectionCounter: public IConnectionCounter {
};
class SimpleConnectionCounter: public IConnectionCounter {
void onConnectionAdded() override { numConnections_++; }
void onConnectionRemoved() override { numConnections_--; }
void onConnectionAdded() override { numConnections_++; }
void onConnectionRemoved() override { numConnections_--; }
- virtual ~SimpleConnectionCounter() {}
+ virtual ~SimpleConnectionCounter() = default;
protected:
uint64_t maxConnections_{0};
protected:
uint64_t maxConnections_{0};
*/
class Callback {
public:
*/
class Callback {
public:
+ virtual ~Callback() = default;
/**
* Invoked when the number of connections managed by the
/**
* Invoked when the number of connections managed by the
- ~ConnectionManager() {}
+ ~ConnectionManager() = default;
ConnectionManager(const ConnectionManager&) = delete;
ConnectionManager& operator=(ConnectionManager&) = delete;
ConnectionManager(const ConnectionManager&) = delete;
ConnectionManager& operator=(ConnectionManager&) = delete;
typedef std::set<SocketAddress, AddressOnlyCompare> AddressSet;
typedef std::set<NetworkAddress> NetworkSet;
typedef std::set<SocketAddress, AddressOnlyCompare> AddressSet;
typedef std::set<NetworkAddress> NetworkSet;
- LoadShedConfiguration() {}
+ LoadShedConfiguration() = default;
- ~LoadShedConfiguration() {}
+ ~LoadShedConfiguration() = default;
void addWhitelistAddr(folly::StringPiece);
void addWhitelistAddr(folly::StringPiece);
+ virtual ~Callback() = default;
/* Invoked when this connection becomes busy */
virtual void onActivated(ManagedConnection& conn) = 0;
/* Invoked when this connection becomes busy */
virtual void onActivated(ManagedConnection& conn) = 0;
return pipeline_.get();
}
return pipeline_.get();
}
- virtual ~ClientBootstrap() {}
+ virtual ~ClientBootstrap() = default;
protected:
std::unique_ptr<Pipeline,
protected:
std::unique_ptr<Pipeline,
pipeline_->setPipelineManager(this);
}
pipeline_->setPipelineManager(this);
}
+ ~ServerConnection() = default;
void timeoutExpired() noexcept override {
}
void timeoutExpired() noexcept override {
}
ServerBootstrap(const ServerBootstrap& that) = delete;
ServerBootstrap(ServerBootstrap&& that) = default;
ServerBootstrap(const ServerBootstrap& that) = delete;
ServerBootstrap(ServerBootstrap&& that) = default;
+ ServerBootstrap() = default;
~ServerBootstrap() {
stop();
~ServerBootstrap() {
stop();
template <class Context>
class HandlerBase {
public:
template <class Context>
class HandlerBase {
public:
- virtual ~HandlerBase() {}
+ virtual ~HandlerBase() = default;
virtual void attachPipeline(Context* ctx) {}
virtual void detachPipeline(Context* ctx) {}
virtual void attachPipeline(Context* ctx) {}
virtual void detachPipeline(Context* ctx) {}
typedef Win win;
typedef Wout wout;
typedef HandlerContext<Rout, Wout> Context;
typedef Win win;
typedef Wout wout;
typedef HandlerContext<Rout, Wout> Context;
+ virtual ~Handler() = default;
virtual void read(Context* ctx, Rin msg) = 0;
virtual void readEOF(Context* ctx) {
virtual void read(Context* ctx, Rin msg) = 0;
virtual void readEOF(Context* ctx) {
typedef Nothing win;
typedef Nothing wout;
typedef InboundHandlerContext<Rout> Context;
typedef Nothing win;
typedef Nothing wout;
typedef InboundHandlerContext<Rout> Context;
- virtual ~InboundHandler() {}
+ virtual ~InboundHandler() = default;
virtual void read(Context* ctx, Rin msg) = 0;
virtual void readEOF(Context* ctx) {
virtual void read(Context* ctx, Rin msg) = 0;
virtual void readEOF(Context* ctx) {
typedef Win win;
typedef Wout wout;
typedef OutboundHandlerContext<Wout> Context;
typedef Win win;
typedef Wout wout;
typedef OutboundHandlerContext<Wout> Context;
- virtual ~OutboundHandler() {}
+ virtual ~OutboundHandler() = default;
virtual Future<void> write(Context* ctx, Win msg) = 0;
virtual Future<void> close(Context* ctx) {
virtual Future<void> write(Context* ctx, Win msg) = 0;
virtual Future<void> close(Context* ctx) {
class PipelineContext {
public:
class PipelineContext {
public:
- virtual ~PipelineContext() {}
+ virtual ~PipelineContext() = default;
virtual void attachPipeline() = 0;
virtual void detachPipeline() = 0;
virtual void attachPipeline() = 0;
virtual void detachPipeline() = 0;
template <class In>
class InboundLink {
public:
template <class In>
class InboundLink {
public:
- virtual ~InboundLink() {}
+ virtual ~InboundLink() = default;
virtual void read(In msg) = 0;
virtual void readEOF() = 0;
virtual void readException(exception_wrapper e) = 0;
virtual void read(In msg) = 0;
virtual void readEOF() = 0;
virtual void readException(exception_wrapper e) = 0;
template <class Out>
class OutboundLink {
public:
template <class Out>
class OutboundLink {
public:
- virtual ~OutboundLink() {}
+ virtual ~OutboundLink() = default;
virtual Future<void> write(Out msg) = 0;
virtual Future<void> close() = 0;
};
virtual Future<void> write(Out msg) = 0;
virtual Future<void> close() = 0;
};
template <class P, class H, class Context>
class ContextImplBase : public PipelineContext {
public:
template <class P, class H, class Context>
class ContextImplBase : public PipelineContext {
public:
+ ~ContextImplBase() = default;
H* getHandler() {
return handler_.get();
H* getHandler() {
return handler_.get();
+ ~ContextImpl() = default;
// HandlerContext overrides
void fireRead(Rout msg) override {
// HandlerContext overrides
void fireRead(Rout msg) override {
- ~InboundContextImpl() {}
+ ~InboundContextImpl() = default;
// InboundHandlerContext overrides
void fireRead(Rout msg) override {
// InboundHandlerContext overrides
void fireRead(Rout msg) override {
- ~OutboundContextImpl() {}
+ ~OutboundContextImpl() = default;
// OutboundHandlerContext overrides
Future<void> fireWrite(Wout msg) override {
// OutboundHandlerContext overrides
Future<void> fireWrite(Wout msg) override {
template <class In, class Out>
class HandlerContext {
public:
template <class In, class Out>
class HandlerContext {
public:
- virtual ~HandlerContext() {}
+ virtual ~HandlerContext() = default;
virtual void fireRead(In msg) = 0;
virtual void fireReadEOF() = 0;
virtual void fireRead(In msg) = 0;
virtual void fireReadEOF() = 0;
template <class In>
class InboundHandlerContext {
public:
template <class In>
class InboundHandlerContext {
public:
- virtual ~InboundHandlerContext() {}
+ virtual ~InboundHandlerContext() = default;
virtual void fireRead(In msg) = 0;
virtual void fireReadEOF() = 0;
virtual void fireRead(In msg) = 0;
virtual void fireReadEOF() = 0;
template <class Out>
class OutboundHandlerContext {
public:
template <class Out>
class OutboundHandlerContext {
public:
- virtual ~OutboundHandlerContext() {}
+ virtual ~OutboundHandlerContext() = default;
virtual Future<void> fireWrite(Out msg) = 0;
virtual Future<void> fireClose() = 0;
virtual Future<void> fireWrite(Out msg) = 0;
virtual Future<void> fireClose() = 0;
class PipelineManager {
public:
class PipelineManager {
public:
- virtual ~PipelineManager() {}
+ virtual ~PipelineManager() = default;
virtual void deletePipeline(PipelineBase* pipeline) = 0;
};
class PipelineBase : public DelayedDestruction {
public:
virtual void deletePipeline(PipelineBase* pipeline) = 0;
};
class PipelineBase : public DelayedDestruction {
public:
- virtual ~PipelineBase() {}
+ virtual ~PipelineBase() = default;
void setPipelineManager(PipelineManager* manager) {
manager_ = manager;
void setPipelineManager(PipelineManager* manager) {
manager_ = manager;
virtual std::unique_ptr<Pipeline, folly::DelayedDestruction::Destructor>
newPipeline(std::shared_ptr<AsyncSocket>) = 0;
virtual std::unique_ptr<Pipeline, folly::DelayedDestruction::Destructor>
newPipeline(std::shared_ptr<AsyncSocket>) = 0;
- virtual ~PipelineFactory() {}
+ virtual ~PipelineFactory() = default;
template <class T>
class BlockingQueue {
public:
template <class T>
class BlockingQueue {
public:
- virtual ~BlockingQueue() {}
+ virtual ~BlockingQueue() = default;
virtual void add(T item) = 0;
virtual void addWithPriority(T item, int8_t priority) {
add(std::move(item));
virtual void add(T item) = 0;
virtual void addWithPriority(T item, int8_t priority) {
add(std::move(item));
// IOThreadPoolExecutor will be created and returned.
class IOExecutor : public virtual Executor {
public:
// IOThreadPoolExecutor will be created and returned.
class IOExecutor : public virtual Executor {
public:
- virtual ~IOExecutor() {}
+ virtual ~IOExecutor() = default;
virtual EventBase* getEventBase() = 0;
};
virtual EventBase* getEventBase() = 0;
};
class ThreadFactory {
public:
class ThreadFactory {
public:
- virtual ~ThreadFactory() {}
+ virtual ~ThreadFactory() = default;
virtual std::thread newThread(Func&& func) = 0;
};
virtual std::thread newThread(Func&& func) = 0;
};
idle(true),
taskStatsSubject(pool->taskStatsSubject_) {}
idle(true),
taskStatsSubject(pool->taskStatsSubject_) {}
+ virtual ~Thread() = default;
static std::atomic<uint64_t> nextId;
uint64_t id;
static std::atomic<uint64_t> nextId;
uint64_t id;
template <class T>
class Subscription {
public:
template <class T>
class Subscription {
public:
+ Subscription() = default;
Subscription(const Subscription&) = delete;
Subscription(const Subscription&) = delete;
class Service {
public:
virtual Future<Resp> operator()(Req request) = 0;
class Service {
public:
virtual Future<Resp> operator()(Req request) = 0;
+ virtual ~Service() = default;
virtual Future<void> close() {
return makeFuture();
}
virtual Future<void> close() {
return makeFuture();
}
public:
explicit ServiceFilter(std::shared_ptr<Service<ReqB, RespB>> service)
: service_(service) {}
public:
explicit ServiceFilter(std::shared_ptr<Service<ReqB, RespB>> service)
: service_(service) {}
- virtual ~ServiceFilter() {}
+ virtual ~ServiceFilter() = default;
virtual Future<void> close() override {
return service_->close();
virtual Future<void> close() override {
return service_->close();
explicit FactoryToService(
std::shared_ptr<ServiceFactory<Pipeline, Req, Resp>> factory)
: factory_(factory) {}
explicit FactoryToService(
std::shared_ptr<ServiceFactory<Pipeline, Req, Resp>> factory)
: factory_(factory) {}
- virtual ~FactoryToService() {}
+ virtual ~FactoryToService() = default;
virtual Future<Resp> operator()(Req request) override {
DCHECK(factory_);
virtual Future<Resp> operator()(Req request) override {
DCHECK(factory_);
folly::DelayedDestruction::DestructorGuard> guard;
} CacheContext;
folly::DelayedDestruction::DestructorGuard> guard;
} CacheContext;
- virtual ~SSLCacheProvider() {}
+ virtual ~SSLCacheProvider() = default;
/**
* Store a session in the external cache.
/**
* Store a session in the external cache.
namespace folly {
struct SSLContextConfig {
namespace folly {
struct SSLContextConfig {
- SSLContextConfig() {}
- ~SSLContextConfig() {}
+ SSLContextConfig() = default;
+ ~SSLContextConfig() = default;
struct CertificateInfo {
CertificateInfo(const std::string& crtPath,
struct CertificateInfo {
CertificateInfo(const std::string& crtPath,
-SSLContextManager::~SSLContextManager() {}
+SSLContextManager::~SSLContextManager() = default;
SSLContextManager::SSLContextManager(
EventBase* eventBase,
SSLContextManager::SSLContextManager(
EventBase* eventBase,