[Boost-bugs] [Boost C++ Libraries] #11066: smart_ptr/detail/sp_convertible.hpp should include <cstddef>

Subject: [Boost-bugs] [Boost C++ Libraries] #11066: smart_ptr/detail/sp_convertible.hpp should include <cstddef>
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2015-03-01 19:04:11


#11066: smart_ptr/detail/sp_convertible.hpp should include <cstddef>
---------------------------------------------+-----------------------
 Reporter: Fedor Sergeev <Fedor.Sergeev@…> | Owner: pdimov
     Type: Bugs | Status: new
Milestone: To Be Determined | Component: smart_ptr
  Version: Boost 1.57.0 | Severity: Problem
 Keywords: |
---------------------------------------------+-----------------------
 smart_ptr/detail/sp_convertible.hpp uses std::size_t type but does not
 include cstddef standard header.

 This can lead to errors if <cstddef> is not included by config headers
 (happens if stdlib configuration part of config headers is disabled).


 {{{
 ] cat smart1.cc
 #include <boost/smart_ptr/intrusive_ptr.hpp>
 ] gcc smart1.cc -DBOOST_NO_CONFIG -I .
 In file included from ./boost/smart_ptr/intrusive_ptr.hpp:20:0,
                  from smart1.cc:1:
 ./boost/smart_ptr/detail/sp_convertible.hpp:61:25: error: 'std::size_t'
 has not been declared
 ]
 }}}
 I got this behavior on Solaris (with Solaris Studio compiler first), but I
 bet it does not matter.

 There is a simple fix:

 {{{
 ] git diff .
 diff --git a/include/boost/smart_ptr/detail/sp_convertible.hpp
 b/include/boost/smart_ptr/detail/sp_convertible.hpp
 index 31b2627..4bba9ed 100644
 --- a/include/boost/smart_ptr/detail/sp_convertible.hpp
 +++ b/include/boost/smart_ptr/detail/sp_convertible.hpp
 @@ -16,6 +16,7 @@
  // http://www.boost.org/LICENSE_1_0.txt

  #include <boost/config.hpp>
 +#include <cstddef>

  #if !defined( BOOST_SP_NO_SP_CONVERTIBLE ) && defined( BOOST_NO_SFINAE )
  # define BOOST_SP_NO_SP_CONVERTIBLE
 ]
 }}}

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/11066>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:18 UTC