• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: C++ code compiles with libstdc++ but not libc++
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: C++ code compiles with libstdc++ but not libc++


  • Subject: Re: C++ code compiles with libstdc++ but not libc++
  • From: Howard Hinnant <email@hidden>
  • Date: Wed, 03 Oct 2012 11:40:43 -0400

On Oct 3, 2012, at 11:33 AM, Jean-Denis MUYS <email@hidden> wrote:

> Which symbol can I test to check what version of the standard library is currently under use?

You can test on:

#ifdef _LIBCPP_VERSION
// using libc++
#else
// using libstdc++
#endif

You should include some std C++03 header first  before testing this.  If you haven't already included such a header and you need to include one gratuitously, my favorite is:

#include <ciso646>  // detect std::lib

#ifdef _LIBCPP_VERSION
// using libc++
#else
// using libstdc++
#endif

<ciso646> is dirt cheap to include.  The standard actually specifies that it should do nothing.  On libstdc++ that's exactly what it does.  On libc++ it defines _LIBCPP_VERSION in addition to the standard spec. ;-)

Howard


 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >C++ code compiles with libstdc++ but not libc++ (From: Jean-Denis MUYS <email@hidden>)
 >Re: C++ code compiles with libstdc++ but not libc++ (From: Howard Hinnant <email@hidden>)
 >Re: C++ code compiles with libstdc++ but not libc++ (From: Jean-Denis MUYS <email@hidden>)
 >Re: C++ code compiles with libstdc++ but not libc++ (From: Howard Hinnant <email@hidden>)
 >Re: C++ code compiles with libstdc++ but not libc++ (From: Jean-Denis MUYS <email@hidden>)

  • Prev by Date: Re: C++ code compiles with libstdc++ but not libc++
  • Next by Date: Re: Source trees and other drives?
  • Previous by thread: Re: C++ code compiles with libstdc++ but not libc++
  • Next by thread: Re: C++ code compiles with libstdc++ but not libc++
  • Index(es):
    • Date
    • Thread