Move all C++ tests to cpp.
This commit is contained in:
31
cpp/any_const_hides_copy_const.cpp
Normal file
31
cpp/any_const_hides_copy_const.cpp
Normal file
@@ -0,0 +1,31 @@
|
||||
#include <iostream>
|
||||
|
||||
struct a
|
||||
{
|
||||
int m;
|
||||
a()
|
||||
: m(0)
|
||||
{}
|
||||
|
||||
//private:
|
||||
a( const a & _ )
|
||||
: m( _.m+1)
|
||||
{}
|
||||
};
|
||||
|
||||
struct b : public a
|
||||
{
|
||||
int n;
|
||||
b()
|
||||
: n(0)
|
||||
{}
|
||||
};
|
||||
|
||||
int main()
|
||||
{
|
||||
b o;
|
||||
b o2 = o;
|
||||
std::cout << o2.m <<' '<<o2.n<< std::endl;
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user