About Chat Legacy Libraries Tips
  1. | API Documentation
  2. | Test
  3. | stlab::annotate

stlab::annotate


A class used to illustrate compiler and object behavior

class annotate

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

stlab::annotate::annotate

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
*/

stlab — modern, modular c++ algorithms and data structures.

Page owner(s): Last updated: 2019-01-03 20:45:53 +0000