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 » Coffee corner » Pick overloaded by Rvalue?
Re: Pick overloaded by Rvalue? [message #19092 is a reply to message #19091] Wed, 12 November 2008 10:48 Go to previous messageGo to previous message
bytefield is currently offline  bytefield
Messages: 210
Registered: December 2007
Experienced Member
cbpporter wrote on Wed, 12 November 2008 09:01

Well I/m more interested in this: Uniform initialization and initialization lists. Seems like GCC can handle this.


I've tried some examples given there but just few work with my g++(4.3.2). For example initializers for POD types work but for types from std library it doesn't work.
Work for:

int i = {1};
double du[] = {2.2, 3.3, 4.4};

Doesn't work for:

std::map<std::string,int> anim = { {"bear",4}, {"cassowary",2}, {"tiger",7} };
std::vector<std::string> vstr = {"Hello", "World", "!"};
std::complex<double> z{1,2};



Some errors:

init.cpp: In function ‘int main()’:
init.cpp:23: error: braces around scalar initializer for type ‘std::map<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, int, std::less<std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<const std::basic_string<char, std::char_traits<char>, std::allocator<char> >, int> > >’


Are these features implemented later in g++, in new versions of g++ from svn?


cdabbd745f1234c2751ee1f932d1dd75
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Looking for someone to convert a ulimate++ project to Microsoft Visual C++ project
Next Topic: Fantastic work!!
Goto Forum:
  


Current Time: Sat May 11 14:43:33 CEST 2024

Total time taken to generate the page: 0.02123 seconds