|
Boost : |
Subject: Re: [boost] [filesystem] path noncopyable error with boost 1.55.0 and g++ 4.5.1
From: Richard Hadsell (hadsell_at_[hidden])
Date: 2014-04-09 13:28:16
On 04/09/2014 12:41 PM, Andrey Semashev wrote:
>
> FWIW, there is BOOST_NO_CXX11_NON_PUBLIC_DEFAULTED_FUNCTIONS macro in
> Boost.Config just for this case. BOOST_DEFAULTED_FUNCTION takes it into
> account.
>
That's a good pointer. I will change noncopyable.hpp to include this flag:
+++ boost/noncopyable.hpp 9 Apr 2014 17:05:09 -0000
@@ -23,7 +23,7 @@
class noncopyable
{
protected:
-#ifndef BOOST_NO_DEFAULTED_FUNCTIONS
+#if !defined(BOOST_NO_DEFAULTED_FUNCTIONS) && !defined(BOOST_NO_CXX11_NON_PUBLIC_DEFAULTED_FUNCTIONS)
BOOST_CONSTEXPR noncopyable() = default;
~noncopyable() = default;
#else
Another possible fix would be to use BOOST_DEFAULTED_FUNCTION for the constructor and destructor, but I'm not sure what happens to 'BOOST_CONSTEXPR', which is not included with the '#else' version of the constructor. So, I'll try out the safer fix I
suggested.
I also didn't replace BOOST_NO_DEFAULTED_FUNCTIONS with BOOST_NO_CXX11_DEFAULTED_FUNCTIONS, not knowing the current preference.
Anyway, I leave it to you to decide how to fix noncopyable.hpp for this minor incompatibility with an ancient compiler. Since BOOST_NO_CXX11_NON_PUBLIC_DEFAULTED_FUNCTIONS exists, it seems reasonable to use it where appropriate.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk