Ticket #11141: test_noncopyable2.cpp
File test_noncopyable2.cpp, 335 bytes (added by , 8 years ago) |
---|
Line | |
---|---|
1 | |
2 | #include <iostream> |
3 | #include <vector> |
4 | |
5 | #include <boost/noncopyable.hpp> |
6 | |
7 | class Foo : private boost::noncopyable |
8 | { |
9 | public: |
10 | Foo() {}; |
11 | }; |
12 | |
13 | class DerivedCopy : public Foo |
14 | { |
15 | public: |
16 | DerivedCopy() : Foo() {} |
17 | }; |
18 | |
19 | int main() |
20 | { |
21 | std::cout << "Hello World\n"; |
22 | DerivedCopy f; |
23 | std::cout << "Now copy the thing\n"; |
24 | DerivedCopy g(f); |
25 | } |