Klasa z jednym obiektem.
Ostatnio zmodyfikowano 2016-10-20 20:17
Gibas11 |
» 2016-10-20 20:17:58 @Up #include <iostream> #include <typeinfo>
class { int i; } object;
int main() { decltype( object ) obj2; std::cout <<( typeid( obj2 ).name() == typeid( object ).name() ) << std::endl; return 0; }
//edit: Jednak nie, typedef nie tworzy nowego, analogicznego typu tylko alias do poprzedniego. Tak się kończy wierzenie w informacje o C++ na forum D. typedef decltype( object ) tajemnaKlasa; tajemnaKlasa obj2; std::cout <<( typeid( obj2 ).name() == typeid( object ).name() ) << std::endl;
1 |
|
1 « 2 » |