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 » U++ Library support » U++ Core » [c++11] Problem with executing callback with Vector
[c++11] Problem with executing callback with Vector [message #44700] Thu, 28 May 2015 14:43 Go to previous message
Zbych is currently offline  Zbych
Messages: 326
Registered: July 2009
Senior Member
Hi,

When I'm trying to pass a vector to a callback routine:

GUI_APP_MAIN
{
	Callback1< Vector<int> > SomeCallback;
	Vector<int> v;
	SomeCallback(v);
}


GCC in c++11 mode gives me error: "use of deleted function":
/home/zbych/upp/uppsrc/Core/Cbgen.h:122:7: error:   initializing argument 1 of void Upp::Callback1<P1>::operator()(P1) const [with P1 = Upp::Vector<Upp::String>]
  void operator()(P1 p1) const   { Execute(p1); }
       ^
/home/zbych/upp/uppsrc/Core/Cbgen.h: In instantiation of void Upp::Callback1<P1>::operator()(P1) const [with P1 = Upp::Vector<Upp::String>]:
/home/zbych/MyApps/GtkTest/main.cpp:46:16:   required from here
/home/zbych/upp/uppsrc/Core/Cbgen.h:122:45: error: use of deleted function constexpr Upp::Vector<Upp::String>::Vector(const Upp::Vector<Upp::String>&)
  void operator()(P1 p1) const   { Execute(p1); }
                                             ^
/home/zbych/upp/uppsrc/Core/Cbgen.h:121:7: error:   initializing argument 1 of void Upp::Callback1<P1>::Execute(P1) const [with P1 = Upp::Vector<Upp::String>]
  void Execute(P1 p1) const      { if(action) action->Execute(p1); }
       ^
/home/zbych/upp/uppsrc/Core/Cbgen.h: In instantiation of void Upp::Callback1<P1>::Execute(P1) const [with P1 = Upp::Vector<Upp::String>]:
/home/zbych/upp/uppsrc/Core/Cbgen.h:122:45:   required from void Upp::Callback1<P1>::operator()(P1) const [with P1 = Upp::Vector<Upp::String>]
/home/zbych/MyApps/GtkTest/main.cpp:46:16:   required from here
/home/zbych/upp/uppsrc/Core/Cbgen.h:121:46: error: use of deleted function constexpr Upp::Vector<Upp::String>::Vector(const Upp::Vector<Upp::String>&)
  void Execute(P1 p1) const      { if(action) action->Execute(p1); }
                                              ^
/home/zbych/upp/uppsrc/Core/Cbgen.h:85:15: error:   initializing argument 1 of void Upp::Callback1Action<P1>::Execute(P1) [with P1 = Upp::Vector<Upp::String>]
  virtual void Execute(P1 p1) = 0;


What am I doing wrong? I don't want to pass a reference or pointer to Vector instead of Vector itself, since it is local object and I want to use PostCallback to pass it to GUI thread.
 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: [solved]How to disable "auto access redirect url " of the HttpRequest?
Next Topic: Do you need a read character literal in CParser?
Goto Forum:
  


Current Time: Tue May 14 21:12:35 CEST 2024

Total time taken to generate the page: 0.02030 seconds