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 » [GCC][C++11] error: call of overloaded 'pick(Upp::Any&)' is ambiguous
[GCC][C++11] error: call of overloaded 'pick(Upp::Any&)' is ambiguous [message #45003] Sat, 15 August 2015 22:35 Go to previous message
Zbych is currently offline  Zbych
Messages: 326
Registered: July 2009
Senior Member
Hi,

When I am trying to turn on c++11 and compile even simplest application:
#include <Core/Core.h>

using namespace Upp;

CONSOLE_APP_MAIN
{
}

gcc (4.8.4/ubuntu1~14.04) shows me this errors

/home/zbych/upp/uppsrc/Core/Other.h:98:70: error: call of overloaded 'pick(Upp::Any&)' is ambiguous
  void operator=(Any rval_ s)                   { Clear(); Pick(pick(s)); }
/home/zbych/upp/uppsrc/Core/Defs.h:391:5: note: T&& Upp::pick(T&) [with T = Upp::Any]
 T&& pick(T& x) { return static_cast<T&&>(x); }
/home/zbych/upp/uppsrc/Core/Defs.h:394:5: note: T&& Upp::pick(T&&) [with T = Upp::Any&]
 T&& pick(T&& x) { return static_cast<T&&>(x); }

It appears that gcc doesn't know which template it should use:

template <typename T>
T&& pick(T& x) { return static_cast<T&&>(x); }

template <typename T>
T&& pick(T&& x) { return static_cast<T&&>(x); }


How can I fix this errors?
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Division by 0 in Thread::Priority
Next Topic: Why Cout() and Cerr() work so different?
Goto Forum:
  


Current Time: Sun May 12 07:41:45 CEST 2024

Total time taken to generate the page: 0.02742 seconds