Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- A a;
- A& ar = a; // both a and ar refer to the same object
- new A; // the object created doesn't have a name
- A* ap = new A[100]; // either all 100 objects share the same name, or need to
- // know that they are part of an array.
- #include <typeinfo>
- #include <iostream>
- template <typename T>
- void foo(T t)
- {
- std::cout << typeid(t).name() << std::endl;
- }
- class NamedObject
- {
- String name;
- NamedObject(String argname)
- {
- name = argname;
- }
- }
- NamedObject phil("phil");
Add Comment
Please, Sign In to add comment