On 2/17/12 1:32 PM, bearophile wrote:
kraybourne:

Then it compiles. Is it possible to have this() figure out the type some
way?

Usually people write a small global function helper.


Hm, so, something like this:

        Foo!(T) newFoo(T)(T val)
        {
                return new Foo!(T)(val);
        }
        ...
        auto o = newFoo(5);

Works! Ha! How silly.
Thanks!




(Side note: What _does_ that error message mean? I don't get it.)

I think the meaning is: when a class template is not yet instantiated, it's not 
a type yet.

Bye,
bearophile

Reply via email to