mirror of
https://github.com/boostorg/unordered.git
synced 2025-07-30 11:27:15 +02:00
Merge pull request #89 from cmazakas/nonnull-warnings-fix
Use `boost::declval` in test metafunctions to avoid `-Wnonnull` warnings
This commit is contained in:
@ -8,6 +8,7 @@
|
|||||||
|
|
||||||
#include <boost/config.hpp>
|
#include <boost/config.hpp>
|
||||||
#include <boost/type_traits/is_same.hpp>
|
#include <boost/type_traits/is_same.hpp>
|
||||||
|
#include <boost/type_traits/declval.hpp>
|
||||||
|
|
||||||
namespace test {
|
namespace test {
|
||||||
template <class Container>
|
template <class Container>
|
||||||
@ -23,7 +24,9 @@ namespace test {
|
|||||||
BOOST_STATIC_CONSTANT(bool,
|
BOOST_STATIC_CONSTANT(bool,
|
||||||
value = sizeof(long) ==
|
value = sizeof(long) ==
|
||||||
sizeof(flip(
|
sizeof(flip(
|
||||||
((Container*)0)->insert(*(typename Container::value_type*)0))));
|
(boost::declval<Container*>())
|
||||||
|
->insert(
|
||||||
|
boost::declval<typename Container::value_type const&>()))));
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user