blob: dfedbc021fe93da1f6793cc695e429a5b1b863a6 [file] [log] [blame]
Jeff Thompsonef2d5a42013-08-22 19:09:24 -07001// Copyright David Abrahams 2006. Distributed under the Boost
2// Software License, Version 1.0. (See accompanying
3// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
Jeff Thompson3d613fd2013-10-15 15:39:04 -07004#ifndef NDNBOOST_CONCEPT_USAGE_DWA2006919_HPP
5# define NDNBOOST_CONCEPT_USAGE_DWA2006919_HPP
Jeff Thompsonef2d5a42013-08-22 19:09:24 -07006
7# include <ndnboost/concept/assert.hpp>
8# include <ndnboost/detail/workaround.hpp>
9# include <ndnboost/concept/detail/backward_compatibility.hpp>
10
11namespace ndnboost { namespace concepts {
12
Jeff Thompson3d613fd2013-10-15 15:39:04 -070013# if NDNBOOST_WORKAROUND(__GNUC__, == 2)
Jeff Thompsonef2d5a42013-08-22 19:09:24 -070014
Jeff Thompson3d613fd2013-10-15 15:39:04 -070015# define NDNBOOST_CONCEPT_USAGE(model) ~model()
Jeff Thompsonef2d5a42013-08-22 19:09:24 -070016
17# else
18
19template <class Model>
20struct usage_requirements
21{
22 ~usage_requirements() { ((Model*)0)->~Model(); }
23};
24
Jeff Thompson3d613fd2013-10-15 15:39:04 -070025# if NDNBOOST_WORKAROUND(__GNUC__, <= 3)
Jeff Thompsonef2d5a42013-08-22 19:09:24 -070026
Jeff Thompson3d613fd2013-10-15 15:39:04 -070027# define NDNBOOST_CONCEPT_USAGE(model) \
Jeff Thompsonef2d5a42013-08-22 19:09:24 -070028 model(); /* at least 2.96 and 3.4.3 both need this :( */ \
Jeff Thompson3d613fd2013-10-15 15:39:04 -070029 NDNBOOST_CONCEPT_ASSERT((ndnboost::concepts::usage_requirements<model>)); \
Jeff Thompsonef2d5a42013-08-22 19:09:24 -070030 ~model()
31
32# else
33
Jeff Thompson3d613fd2013-10-15 15:39:04 -070034# define NDNBOOST_CONCEPT_USAGE(model) \
35 NDNBOOST_CONCEPT_ASSERT((ndnboost::concepts::usage_requirements<model>)); \
Jeff Thompsonef2d5a42013-08-22 19:09:24 -070036 ~model()
37
38# endif
39
40# endif
41
42}} // namespace ndnboost::concepts
43
Jeff Thompson3d613fd2013-10-15 15:39:04 -070044#endif // NDNBOOST_CONCEPT_USAGE_DWA2006919_HPP