Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
C++ MSVN Compiler Type Check
//Microsoft (R) C/C++ Optimizing Compiler Version 19.00.23506 for x64 #include <iostream> #include <typeinfo> #include <string> #include <vector> #include <queue> #include <memory> using namespace std; #define PRINT_NAME(x) std::cout << #x << " - " << typeid(x).name() << '\n' class A { A() { this->a = new int(0); } explicit A(int i) { if (this->a == nullptr) this->a = new int(i); else { *this->a = i; } } A(const A& A2) { *this->a = *A2.a; } A(const A&& A2) { *this->a = *A2.a; } ~A() { delete(this->a); } private: int* a = nullptr; }; int main() { PRINT_NAME(char); PRINT_NAME(signed char); PRINT_NAME(unsigned char); PRINT_NAME(short); PRINT_NAME(unsigned short); PRINT_NAME(int); PRINT_NAME(unsigned int); PRINT_NAME(long); PRINT_NAME(unsigned long); PRINT_NAME(float); PRINT_NAME(double); PRINT_NAME(long double); PRINT_NAME(char*); PRINT_NAME(const char*); PRINT_NAME(int*); PRINT_NAME(const int*); PRINT_NAME(const int* const); PRINT_NAME(unsigned int*); PRINT_NAME(const unsigned int*); PRINT_NAME(float*); PRINT_NAME(const float*); PRINT_NAME(const float* const); PRINT_NAME(double *); PRINT_NAME(const double*); PRINT_NAME(const double* const); PRINT_NAME(string); PRINT_NAME(string&); PRINT_NAME(string*); PRINT_NAME(vector<int>); PRINT_NAME(vector<char>&); PRINT_NAME(vector<string>*); PRINT_NAME(queue<float>); PRINT_NAME(queue<string>&); PRINT_NAME(queue<int*>*); PRINT_NAME(' '); PRINT_NAME(""); PRINT_NAME(NULL); PRINT_NAME(nullptr); PRINT_NAME(shared_ptr<int>); PRINT_NAME(shared_ptr<vector<int>>); PRINT_NAME(shared_ptr<queue<string>>); PRINT_NAME(unique_ptr<float>); PRINT_NAME(unique_ptr<double*>); PRINT_NAME(unique_ptr<vector<int>>); PRINT_NAME(A); PRINT_NAME(A&); PRINT_NAME(A*); PRINT_NAME(vector<A>); PRINT_NAME(vector<A*>); PRINT_NAME(shared_ptr<A>); PRINT_NAME(unique_ptr<vector<A>>); }
run
|
edit
|
history
|
help
0
msvc compile optimization demo...
Struct packing
Removing __unaligned specifier partial solution
Preserving strict aliasing Union example
delete from list
define_xml_tags
Fast sine to fill array (sin/cos pair)
Program_1_rstring
Kare-Küp Tablosu
#9