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