certik / yaml-cpp

Automatically exported from code.google.com/p/yaml-cpp
MIT License
0 stars 0 forks source link

auto_ptr deprecated #245

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1.Compile under GCC 4.7 or higher
2.Turn on -std=g++11
3.

What is the expected output? What do you see instead?
Expected: no warnings
Get: warning: ‘auto_ptr’ is deprecated

What version of the product are you using? On what operating system?
0.5.1
CentOS 6.5 with RHEL dev tools installed

Please provide any additional information below.
auto_ptr is deprecated under c++11

Original issue reported on code.google.com by del...@gmail.com on 23 Apr 2014 at 1:12

GoogleCodeExporter commented 9 years ago
I'll mark this as "accepted", but I'm not ready to require C++11. Maybe only 
for the new API, not sure...

Original comment by jbe...@gmail.com on 23 Apr 2014 at 1:19

GoogleCodeExporter commented 9 years ago
May be use a macro to enable compatibility with c++11?

#ifdef YAML_CXX11_ON
#   define YAML_CXX_PTR std::unique_ptr
#else
#   define YAML_CXX_PTR std::auto_ptr
#endif

Then just use YAML_CXX_PTR in the code.

Original comment by 4mwgl...@gmail.com on 9 Jan 2015 at 10:41

GoogleCodeExporter commented 9 years ago
I'm marking this as a dupe of the C++11 issue, which I've bumped in importance.

Original comment by jbe...@gmail.com on 10 Jan 2015 at 5:15

GoogleCodeExporter commented 9 years ago
Out of curiosity, why can't you accept C++11? Aren't C++11 compilers ubiquitous 
at this point?

Original comment by rui.pacheco on 12 Jan 2015 at 2:51

GoogleCodeExporter commented 9 years ago
No, they're definitely not :)

Original comment by jbe...@gmail.com on 12 Jan 2015 at 2:59

GoogleCodeExporter commented 9 years ago
Even CentOS/RedHat has devtoolset to bring c++11 compilers into play, and 
Windows has released VS13 for free (Community Edition).

Is there any reason there can't be an 0.6 release that requires C++11?  I'm 
curious what environments don't have access to it yet.

Original comment by del...@gmail.com on 12 Jan 2015 at 3:05

GoogleCodeExporter commented 9 years ago
I think the 0.6 release will require C++11, but I've been hesitant to make the 
switch because I've been careful to keep yaml-cpp building on Very Old 
Compilers too.

Original comment by jbe...@gmail.com on 12 Jan 2015 at 3:26