Move all C++ tests to cpp.

This commit is contained in:
2014-05-31 22:55:50 +04:00
parent 1c1c6fe543
commit 7cdff553c8
52 changed files with 0 additions and 0 deletions

41
cpp/temporary_objects.cpp Normal file
View File

@@ -0,0 +1,41 @@
#include <iostream>
class a
{
public:
a()
{
std::cout << "construction" << std::endl;
}
~a()
{
std::cout << "destruction" << std::endl;
}
};
class guard
{
public:
a _a;
a* operator & ()
{
return &_a;
}
};
guard f()
{
return guard();
}
void g ( a* p )
{
std::cout << "working with a" << std::endl;
}
int main()
{
g( &f() );
return 0;
}