Subject: [boost] [variant] static_visitor constructor error with boost 1.56.0 and g++ 4.5.1
From: Richard Hadsell (hadsell_at_[hidden])
Date: 2014-08-14 14:54:25
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
#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
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>
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk