T
TheDD
red said:Why are you using new? Why not just:
throw Class args << Location(__FILE__, __LINE__)T& operator << (const Location& loc)[redacted]
43
44 template <typename T>
45 class Ex_ : public Ex
46 {
47 public:
48 T & operator << (Location * loc)// delete loc; // line not needed.49 {
50 this->loc = *loc; this->loc = loc;
51 delete loc;
52
53 T * real = dynamic_cast<T *>(this);
54 assert(real);
55 return *real;
56 }
57 };
58
[redacted]
thx, i've changed my code, but i used to think that in c++ you can't do:
obj.method(Class(args));
but
Class c(args);
obj.method(c);
so i thought i was the same in the case of << (don't understand why it's
not)
BTW, i don't know the rationale of that.