nonstandard extension used: 'initializing': a non-const 'type1' must be initialized with an l-value, not a function returning 'type2'
A nonconst reference must be initialized with an l-value, making the reference a name for that l-value. A function call is an l-value only if the return type is a reference. Under Microsoft extensions to the C++ language, treat any function call as an l-value for the purpose of initializing references. If Microsoft extensions are disabled (/Za), an error occurs.
Example
struct X { X(int); X(X&); }; X f(X); X b = f(X(2)); // warning
To avoid this warning
#pragma warning(disable:4270)