Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » Community » Newbie corner » Problems with AddPick operator| in Vector
Problems with AddPick operator| in Vector [message #46463] Fri, 13 May 2016 03:55 Go to previous message
Infausto is currently offline  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.
 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Translations in header file
Next Topic: Map with unique keys and transfer semantics?
Goto Forum:
  


Current Time: Sat Apr 27 15:53:00 CEST 2024

Total time taken to generate the page: 0.04719 seconds