On Wednesday, 3 April 2013 at 11:05:06 UTC, Tobias Pankrath wrote:
basic idea. --- T x; T* px = new T(x); --- int x int* px = new int(x); // fails ---I need to do this for structs and basic types. What's the standard way to do this?
Do you need to use new? i.e. do you need the variable to be allocated on the heap? Also, as you've written it, px is not a pointer to x which is a bit misleading. What is the result you actually want?