stlab::annotate
A class used to illustrate compiler and object behavior
|
Annotate will increase a passed operation counter when one of these operations happen to an instance:
- dtor
- copy-ctor
- move-ctor
- copy-assign
- move-assign
- swap
In addition, operator==
is always true
, and operator!=
is always false
.
Member Functions
Constructs an annotate |
Example 1
#include <stlab/test/model.hpp>
using namespace stlab;
annotate_counters counters;
auto make_annotate() {
return annotate(counters);
}
int main(int, char**) {
{
auto a = make_annotate();
}
std::cout << counters;
}
/*
Result:
dtor: 1
copy_ctor: 0
move_ctor: 0
copy_assign_lhs: 0
copy_assign_rhs: 0
move_assign_lhs: 0
move_assign_rhs: 0
swap: 0
equality: 0
*/