#ifndef EXAMPLE_SUB_H #define EXAMPLE_SUB_H #include #include #include #include #include //------------------------------------------------------ // Define symbol _USE_MOVE to enable use of move constructor // and move assign operator. // We define that symbol on the command line, in the makefile, // but a somewhat more clumsy way to do it would be to embed // one of the following two lines here: // #undef _USE_MOVE // #define _USE_MOVE //------------------------------------------------------ class Example { public: Example(const char* str); Example(const Example &other); Example& operator=(const Example &other); //------------------------------------------------------- #ifdef _USE_MOVE Example(Example &&other) noexcept; Example& operator=(Example &&other) noexcept; #endif // _USE_MOVE //------------------------------------------------------- virtual ~Example(); Example exampleFunc(const Example ex); char const * name() const { return nameStr ? nameStr : ""; } static std::string countString(); private: char* nameStr; static int nMoveConstructors; static int nCopyConstructors; static int nMoveAssigns; static int nCopyAssigns; }; #endif // EXAMPLE_SUB_H