Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class BaseClass
- {
- public:
- BaseClass( const std::string& name ) : m_name( name ) { }
- const std::string& getName() const { return m_name; }
- private:
- const std::string m_name;
- //...
- };
- class DerivedClass : public BaseClass
- {
- public:
- DerivedClass( const std::string& name ) : BaseClass( name ) { }
- // ...
- };
- class TestClass :
- {
- public:
- TestClass( int testValue ); //...
- };
- class UniqueTestClass
- : public BaseClass
- , public TestClass
- {
- public:
- UniqueTestClass()
- : BaseClass( "UniqueTest" )
- , TestClass( 42 )
- { }
- // ...
- };
- class Foo
- {
- Foo(char* c, int i);
- };
- void Bar(Foo foo);
- Bar(Foo("hello", 5));
- Foo foo;
- foo.Foo(); // compile error!
- char buffer[sizeof(Foo)]; // a bit of memory
- Foo* foo = new(buffer) Foo(); // construct a Foo inside buffer
Add Comment
Please, Sign In to add comment