Home » Community » Newbie corner » Problems with AddPick operator| in Vector
Problems with AddPick operator| in Vector [message #46463] |
Fri, 13 May 2016 03:55  |
Infausto
Messages: 28 Registered: June 2008
|
Promising Member |
|
|
Hi everyone:
I got the following code:
class Caps : Moveable<Caps>
{
public :
Caps() = default;
rval_default(Caps);
};
Caps item1;
Caps item2;
Vector<Caps> list;
list.AddPick(pick(item1)); // works fine
list | pick(item2); // Throws error.
MSC says: Cannot convert argument 1 from 'Caps' to 'Caps &&'
GCC says: Cannot bind 'Caps' lvalue to 'Caps&&'
The error is thrown when the following code is reached:
Vcont.h
...
95: Vector& operator|(T rval_ x) { AddPick(x); return *this; }
...
AddPick(x) is the offending sentence. Why?
Many thanks in advance.
|
|
|
Goto Forum:
Current Time: Tue Apr 29 23:27:52 CEST 2025
Total time taken to generate the page: 0.00912 seconds
|