Boost logo

Boost :

Subject: Re: [boost] C++17 detection
From: Glen Fernandes (glen.fernandes_at_[hidden])
Date: 2017-09-10 19:07:12

On Sun, Sep 10, 2017 at 1:30 PM, Robert Ramey via Boost wrote:
> How do I get ready for C++17?
> I have a piece of code which requires C++14. I want to use something from
> C++17 but I also want my code to work now. So I have
> #if C++14 being used
> namespace std {
> // implement C++ function
> }

Don't define those things inside namespace std. Instead:

  namespace boost {
  namespace yours {
  namespace detail {
#if /* C++17 thing available */
      using std::thing;
      /* Define thing yourself */
  } } }

And then use boost::yours::detail::thing in your library.


Boost list run by bdawes at, gregod at, cpdaniel at, john at