Merge pull request #89 from cmazakas/nonnull-warnings-fix

Use `boost::declval` in test metafunctions to avoid `-Wnonnull` warnings
This commit is contained in:
Peter Dimov
2022-02-10 01:19:14 +02:00
committed by GitHub

View File

@ -8,6 +8,7 @@
#include <boost/config.hpp>
#include <boost/type_traits/is_same.hpp>
#include <boost/type_traits/declval.hpp>
namespace test {
template <class Container>
@ -23,7 +24,9 @@ namespace test {
BOOST_STATIC_CONSTANT(bool,
value = sizeof(long) ==
sizeof(flip(
((Container*)0)->insert(*(typename Container::value_type*)0))));
(boost::declval<Container*>())
->insert(
boost::declval<typename Container::value_type const&>()))));
};
}