![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#21 |
|
Professional Programmer
Join Date: Jan 2007
Location: Cape Town
Posts: 291
Rep Power: 3
![]() |
hey, so it appears that i have to declare all the code inline for it to work???
i.e. class Object {
public:
//constructors
Object() : this_object(0) {}
template<typename ObjectType>
Object(const ObjectType &value) : this_object(new holder<ObjectType>(value)) {}
...
};works but if i do this: //Object.h
class Object {
public:
//constructors
Object();
template<typename ObjectType> Object(const ObjectType &);
...
};
//Object.cpp
...
//overloaded constructor
template<typename ObjectType>
Object::Object(const ObjectType &value) : this_object(new holder<ObjectType>(value)) {}
...it stuffs up???? why? ![]() |
|
|
|
|
|
#22 |
|
Professional Programmer
Join Date: Jan 2007
Location: Cape Town
Posts: 291
Rep Power: 3
![]() |
ah, also there seems to be a problem here:
int main() {
//
float flt(3.34343);
Object myobj(flt);
cout << myobj.GetType().name() << endl;
return 0;
}the output is: it should be "float" ???? wtf? |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Level Editor | frankish | Show Off Your Open Source Projects | 47 | Jul 10th, 2006 7:57 PM |
| The Black Art of Video Game Console Design | lostcauz | Book Reviews | 0 | Apr 26th, 2006 8:31 PM |
| Attitudes | Oddball | Coder's Corner Lounge | 29 | Mar 18th, 2006 10:34 PM |
| object oriented game design | furqanchandio | Other Programming Languages | 5 | May 11th, 2005 10:17 AM |
| Moving Object ... Question . | ASHORY | Visual Basic | 1 | Mar 14th, 2005 3:17 PM |