[variant] static_visitor constructor error with boost 1.56.0 and g++ 4.5.1
I am trying to upgrade from Boost 1.55 to 1.56. I get this error with G++ 4.5.1: In file included from ...: .../boost/variant/static_visitor.hpp:52:24: error: 'boost::static_visitor<R>::static_visitor()' declared with non-public access cannot be defaulted in the class body .../boost/variant/static_visitor.hpp:53:25: error: 'boost::static_visitor<R>::~static_visitor()' declared with non-public access cannot be defaulted in the class body The OS is Linux Fedora 14. The compiler is gcc version 4.5.1 20100924 (Red Hat 4.5.1-4). I saw a similar problem in noncopyable.hpp, when upgrading to Boost 1.55. Andrey Semashev fixed it, and it looks like static_visitor requires the same fix. In static_visitor.hpp change line 51 from #ifndef BOOST_NO_DEFAULTED_FUNCTIONS to #if !defined(BOOST_NO_CXX11_DEFAULTED_FUNCTIONS) && !defined(BOOST_NO_CXX11_NON_PUBLIC_DEFAULTED_FUNCTIONS) I think this would be appropriate for any non-public defaulted functions, not just the ones that trip up code I happen to compile. Dick Hadsell 203-992-6320 Fax: 203-992-6001 Reply-to: hadsell@blueskystudios.com Blue Sky Studioshttp://www.blueskystudios.com 1 American Lane, Greenwich, CT 06831-2560 Follow Blue Sky Studios on Facebook http://www.facebook.com/BlueSkyStudios and Twitter http://twitter.com/#%21/blueskystudios
2014-08-14 22:54 GMT+04:00 Richard Hadsell
I am trying to upgrade from Boost 1.55 to 1.56. I get this error with G++ 4.5.1:
In file included from ...: .../boost/variant/static_visitor.hpp:52:24: error: 'boost::static_visitor<R>::static_visitor()' declared with non-public access cannot be defaulted in the class body .../boost/variant/static_visitor.hpp:53:25: error: 'boost::static_visitor<R>::~static_visitor()' declared with non-public access cannot be defaulted in the class body
<..>
In static_visitor.hpp change line 51 from
#ifndef BOOST_NO_DEFAULTED_FUNCTIONS
to
#if !defined(BOOST_NO_CXX11_DEFAULTED_FUNCTIONS) && !defined(BOOST_NO_CXX11_NON_PUBLIC_DEFAULTED_FUNCTIONS)
I think this would be appropriate for any non-public defaulted functions, not just the ones that trip up code I happen to compile.
Thanks for the bug report and for providing a patch! Fixed that issue in develop branch: https://github.com/boostorg/variant/commit/8f111d3126c5a706f0eca0b90f5e01c9a... -- Best regards, Antony Polukhin
participants (2)
-
Antony Polukhin
-
Richard Hadsell