Adobe Source Libraries 1.49.0
A collection of C++ libraries.
Loading...
Searching...
No Matches
check_null.hpp
Go to the documentation of this file.
1/*
2 Copyright 2013 Adobe
3 Distributed under the Boost Software License, Version 1.0.
4 (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
5*/
6/**************************************************************************************************/
7
8#include <adobe/config.hpp>
9#include <boost/test/unit_test.hpp>
10
11namespace adobe {
16
17template <typename T>
18void check_null(const T& x) {
19 T t = T();
20 if (t)
21 BOOST_ERROR("operator bool");
22 BOOST_CHECK_MESSAGE(!t, "operator!");
23
24 BOOST_CHECK_MESSAGE(x, "operator!");
25 if (!x)
26 BOOST_ERROR("operator bool");
27}
28
29} // namespace adobe
void check_null(const T &x)