From 4d6a509efe6bd56613b5554556d3a4f7f4cfd0d5 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Thu, 5 Feb 2015 20:54:12 +0000 Subject: convert all remaining BOOST_STATIC_ASSERT to static_assert and we can include a few less headers Change-Id: Id742849ff4c1c37a2b861aa3d6ab823f00ea87f8 --- sal/cppunittester/cppunittester.cxx | 3 +-- sal/rtl/strtmpl.cxx | 5 ++--- sal/textenc/tables.cxx | 8 +++----- 3 files changed, 6 insertions(+), 10 deletions(-) (limited to 'sal') diff --git a/sal/cppunittester/cppunittester.cxx b/sal/cppunittester/cppunittester.cxx index 59aee5ac053f..2e791f240d7a 100644 --- a/sal/cppunittester/cppunittester.cxx +++ b/sal/cppunittester/cppunittester.cxx @@ -49,7 +49,6 @@ #include "boost/noncopyable.hpp" #include -#include "boost/static_assert.hpp" namespace { @@ -69,7 +68,7 @@ rtl::OUString getArgument(sal_Int32 index) { std::string convertLazy(rtl::OUString const & s16) { rtl::OString s8(rtl::OUStringToOString(s16, osl_getThreadTextEncoding())); - BOOST_STATIC_ASSERT(sizeof (sal_Int32) <= sizeof (std::string::size_type)); + static_assert(sizeof (sal_Int32) <= sizeof (std::string::size_type), "must be at least the same size"); // ensure following cast is legitimate return std::string( s8.getStr(), static_cast< std::string::size_type >(s8.getLength())); diff --git a/sal/rtl/strtmpl.cxx b/sal/rtl/strtmpl.cxx index 6b9265895064..a50c3641949d 100644 --- a/sal/rtl/strtmpl.cxx +++ b/sal/rtl/strtmpl.cxx @@ -30,7 +30,6 @@ #include #include #include -#include /* inline void rtl_str_ImplCopy( IMPL_RTL_STRCODE* pDest, @@ -957,7 +956,7 @@ namespace { template static inline T IMPL_RTL_STRNAME( toInt )( const IMPL_RTL_STRCODE* pStr, sal_Int16 nRadix ) { - BOOST_STATIC_ASSERT(std::numeric_limits::is_signed); + static_assert(std::numeric_limits::is_signed, "is signed"); bool bNeg; sal_Int16 nDigit; U n = 0; @@ -1045,7 +1044,7 @@ namespace { template static inline T IMPL_RTL_STRNAME( toUInt )( const IMPL_RTL_STRCODE* pStr, sal_Int16 nRadix ) { - BOOST_STATIC_ASSERT(!std::numeric_limits::is_signed); + static_assert(!std::numeric_limits::is_signed, "is not signed"); sal_Int16 nDigit; T n = 0; diff --git a/sal/textenc/tables.cxx b/sal/textenc/tables.cxx index 1c8462c53523..4468bbb900eb 100644 --- a/sal/textenc/tables.cxx +++ b/sal/textenc/tables.cxx @@ -24,8 +24,6 @@ #include #include -#include - #include "rtl/textenc.h" #include "sal/types.h" @@ -261,9 +259,9 @@ extern "C" SAL_DLLPUBLIC_EXPORT ImplTextEncodingData const * &aImplPT154TextEncodingData, /* PT154 */ &adobeDingbatsEncodingData }; /* ADOBE_DINGBATS */ - //update table above if a new encoding is added - BOOST_STATIC_ASSERT( - SAL_N_ELEMENTS(aData) == RTL_TEXTENCODING_ADOBE_DINGBATS + 1); + static_assert( + SAL_N_ELEMENTS(aData) == RTL_TEXTENCODING_ADOBE_DINGBATS + 1, + "update table above if a new encoding is added"); return nEncoding < SAL_N_ELEMENTS(aData) ? aData[nEncoding] : NULL; -- cgit