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 » I don't understand Moveable (probleme on moveable (operateur*))
I don't understand Moveable [message #50338] Thu, 27 September 2018 14:10 Go to previous message
Xemuth is currently offline  Xemuth
Messages: 387
Registered: August 2018
Location: France
Senior Member
Hello Everyone,

I have a class that contains only two string :

class Argument{
     public:
Argument(Upp::String argname, Upp::String argvalue);
	   	Argument();
		Upp::String ArgName; 
		Upp::String ArgValue;
};


Somewhere in my code I want to do some Vector of "Argument" :
	Upp::Vector<Argument> mesArguments;
	mesArguments.Insert(mesArguments.GetCount() ,Argument("test1","test1"));
	mesArguments.Insert(mesArguments.GetCount(),Argument("test2","test2"));
	mesArguments.Insert(mesArguments.GetCount(),Argument("test3","test3"));

and later in my code I past this vector through a Method that copy the vector into another vector :
void RequetageSoap::SetLesArgs(const Upp::Vector<Argument> &lesargs){
  	for(Argument arg : lesargs){
		this->lesArgs.Insert(this->lesArgs.GetCount(),arg);	// Here lesArgs is my Secondary vector of Argument
	}
}

When I compile it I got this kind of error : C:\Upp\upp/uppsrc/Core/Topt.h (157): error: no match for 'operator*' (operand type is 'Argument')

According to : https://www.ultimatepp.org/srcdoc$Core$Moveable$en-us.html
it happen because Argument is not marked as moveable

so I juste try to inherite my class Argument with : Moveable<Argument> but I got a lot of errors at compilation :
class Argument : Moveable<Argument>{
	    public:
	    Argument(Upp::String argname, Upp::String argvalue);
	    Argument();
		Upp::String ArgName;
		Upp::String ArgValue;
};


C:\Upp\upp\MyApps\TestCallSoap\RequetageSoap.h (10): error: expected template-name before '<' token
C:\Upp\upp\MyApps\TestCallSoap\testCallSoap.cpp (2): In file included from C:\Upp\upp\MyApps\TestCallSoap\testCallSoap.cpp:2:0:
(): class Argument : Moveable<Argument>{
C:\Upp\upp\MyApps\TestCallSoap\RequetageSoap.h (10): error: expected '{' before '<' token
C:\Upp\upp\MyApps\TestCallSoap\RequetageSoap.h (10): error: expected unqualified-id before '<' token
C:\Upp\upp\MyApps\TestCallSoap\testCallSoap.cpp (40): error: invalid use of incomplete type 'class Argument'
C:\Upp\upp\MyApps\TestCallSoap\testCallSoap.cpp (41): error: invalid use of incomplete type 'class Argument'
...
can Someone explain me why ?

(sorry for my bad english)

Thanks in advance
 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Adding a socket to a GUI application
Next Topic: RLOG in Linux
Goto Forum:
  


Current Time: Thu Apr 25 14:39:58 CEST 2024

Total time taken to generate the page: 0.02247 seconds