proxygen
CopyCounter Struct Reference

Public Member Functions

 CopyCounter ()
 
 CopyCounter (CopyCounter &&source) noexcept
 
 CopyCounter (const CopyCounter &source)
 
 ~CopyCounter ()
 
CopyCounteroperator= (const CopyCounter &source)
 
CopyCounteroperator= (CopyCounter &&source)
 

Public Attributes

int copies
 
int moves
 

Static Public Attributes

static int alive = 0
 

Detailed Description

Definition at line 953 of file BaseTest.cpp.

Constructor & Destructor Documentation

CopyCounter::CopyCounter ( )
inline

Definition at line 958 of file BaseTest.cpp.

958  : copies(0), moves(0) {
959  ++alive;
960  }
static int alive
Definition: BaseTest.cpp:954
CopyCounter::CopyCounter ( CopyCounter &&  source)
inlinenoexcept

Definition at line 962 of file BaseTest.cpp.

References folly::gen::move.

962  {
963  *this = std::move(source);
964  ++alive;
965  }
constexpr detail::Map< Move > move
Definition: Base-inl.h:2567
static int alive
Definition: BaseTest.cpp:954
CopyCounter::CopyCounter ( const CopyCounter source)
inline

Definition at line 967 of file BaseTest.cpp.

967  {
968  *this = source;
969  ++alive;
970  }
static int alive
Definition: BaseTest.cpp:954
CopyCounter::~CopyCounter ( )
inline

Definition at line 972 of file BaseTest.cpp.

972  {
973  --alive;
974  }
static int alive
Definition: BaseTest.cpp:954

Member Function Documentation

CopyCounter& CopyCounter::operator= ( const CopyCounter source)
inline

Definition at line 976 of file BaseTest.cpp.

References copies, and moves.

976  {
977  this->copies = source.copies + 1;
978  this->moves = source.moves;
979  return *this;
980  }
CopyCounter& CopyCounter::operator= ( CopyCounter &&  source)
inline

Definition at line 982 of file BaseTest.cpp.

References alive, and copies.

982  {
983  this->copies = source.copies;
984  this->moves = source.moves + 1;
985  return *this;
986  }

Member Data Documentation

int CopyCounter::alive = 0
static

Definition at line 954 of file BaseTest.cpp.

Referenced by operator=().

int CopyCounter::copies

Definition at line 955 of file BaseTest.cpp.

Referenced by operator=().

int CopyCounter::moves

Definition at line 956 of file BaseTest.cpp.

Referenced by operator=().


The documentation for this struct was generated from the following file: