Intel® C++ Compiler
Community support and assistance for creating C++ code that runs on platforms based on Intel® processors.

std::move with icc 15.0 on OS X ?

James_Burgess
Beginner
426 Views

 Hi,

I have a lot of code and libraries on the mac that were built with libstdc++. I'm wondering if there is a way I can compile things to continue to use that version of the c runtime and yet use modern c++ features, in particular std::move. There doesn't seem to be any way to do this because the headers you get with you turn on -stdlib=libstdc++ are the apple headers that don't even have std::move.

Ultimately it seems like I'm going to need to switch to libc++ but I thought I would ask here if there was any way to get around this and use this newer c++ feature. I don't need initializer_list or variadic templates for instance.

thanks,

James

I have the latest Xcode 6 installed on Yosemite.

0 Kudos
3 Replies
Feilong_H_Intel
Employee
426 Views

Hi James,

I talked to a developer in our engineering team.  He suggested that the best option is to switch to default libc++.  He would not recommend building newer GCC’s libstdc++ from MacPorts – it should be possible but we have never tested it.

Thanks.

0 Kudos
Sergey_M_Intel
Employee
426 Views

Hi James,

Just to clarify Feilong's answer. libstdc++ on OS X is a bit old and doesn't support C++11 features. Also, we don't support MacPorts.Thus, the only solution is to use libc++ if you'd like to use C++11 features.

--Sergey

0 Kudos
James_Burgess
Beginner
426 Views

Thanks Sergey, 

This makes sense to me I was just checking that I hadn't missed something. We have a lot of code compiled with libstdc++ and some other requirements to work as plugins to other applications that will be in the field for at least a couple of years. This makes it that much more difficult for us to adopt all the new compiler versions/features that we want to so I thought it worth posing the question.

Regards,

- James

 

0 Kudos
Reply