3 ms·
If you ever write code like template<class T> struct Loop { Loop<T*> operator->(); }; Loop<int> i, j = i->hooray; at work you are shown by the language that you
by bad_alloc 16y ago
If you ever write code like
template<class T> struct Loop { Loop<T*> operator->(); };
Loop<int> i, j = i->hooray;
at work you are shown by the language that you have probably failed to think before you code. A plus in C++, rather than a downsinde.
If you begin to realize that you need garbage collection you probably failed while choosing the appropriate language for your project or subproblem.
Same thing here:
struct a{typedef int foo;};struct a1:a{};struct a2:a{};
#define X(b,a) struct a##1:b##1,b##2{};struct a##2:b##1,b##2{};
X(a,b)X(b,c)X(c,d)X(d,e)X(e,f)X(f,g)X(g,h)X(h,i)X(i,j)X(j,k)X(k,l)
X(l,m)X(m,n) n1::foo main(){}
Wich sane person would consider writing this a good idea?