Ticket #8888: 0003-python-Convert-a-static-assert-like-construct-to-BOO.patch

File 0003-python-Convert-a-static-assert-like-construct-to-BOO.patch, 1.1 KB (added by Petr Machata <pmachata@…>, 9 years ago)

This converts one additional static-assert-like construct with BOOST_STATIC_ASSERT.

  • boost/python/cast.hpp

    From e11fbe4ab773e456d560d12ef073d373b3249fae Mon Sep 17 00:00:00 2001
    From: Petr Machata <pmachata@redhat.com>
    Date: Thu, 5 Sep 2013 23:26:14 +0200
    Subject: [PATCH 3/3] [python] Convert a static-assert-like construct to
     BOOST_STATIC_ASSERT
    
    - Since for failures, this will never evaluate anyway, there's no need
      to use BOOST_MPL_ASSERT_MSG.
    ---
     boost/python/cast.hpp |    4 +++-
     1 files changed, 3 insertions(+), 1 deletions(-)
    
    diff --git a/boost/python/cast.hpp b/boost/python/cast.hpp
    index 31c61db..90be1e6 100644
    a b  
    1212# include <boost/type.hpp>
    1313# include <boost/python/base_type_traits.hpp>
    1414# include <boost/python/detail/convertible.hpp>
     15# include <boost/static_assert.hpp>
    1516
    1617namespace boost { namespace python {
    1718
    namespace detail  
    7071  template <class T>
    7172  inline void assert_castable(boost::type<T>* = 0)
    7273  {
    73       typedef char must_be_a_complete_type[sizeof(T)];
     74      // T must be a complete type.
     75      BOOST_STATIC_ASSERT(sizeof(T) == sizeof(T));
    7476  }
    7577
    7678  template <class Source, class Target>