Jeff Thompson | ef2d5a4 | 2013-08-22 19:09:24 -0700 | [diff] [blame] | 1 | // 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 Thompson | 2491bd6 | 2013-10-15 17:10:24 -0700 | [diff] [blame] | 4 | #ifndef NDNBOOST_CONCEPT_USAGE_NDNBOOST_DWA2006919_HPP |
| 5 | # define NDNBOOST_CONCEPT_USAGE_NDNBOOST_DWA2006919_HPP |
Jeff Thompson | ef2d5a4 | 2013-08-22 19:09:24 -0700 | [diff] [blame] | 6 | |
| 7 | # include <ndnboost/concept/assert.hpp> |
| 8 | # include <ndnboost/detail/workaround.hpp> |
| 9 | # include <ndnboost/concept/detail/backward_compatibility.hpp> |
| 10 | |
| 11 | namespace ndnboost { namespace concepts { |
| 12 | |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 13 | # if NDNBOOST_WORKAROUND(__GNUC__, == 2) |
Jeff Thompson | ef2d5a4 | 2013-08-22 19:09:24 -0700 | [diff] [blame] | 14 | |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 15 | # define NDNBOOST_CONCEPT_USAGE(model) ~model() |
Jeff Thompson | ef2d5a4 | 2013-08-22 19:09:24 -0700 | [diff] [blame] | 16 | |
| 17 | # else |
| 18 | |
| 19 | template <class Model> |
| 20 | struct usage_requirements |
| 21 | { |
| 22 | ~usage_requirements() { ((Model*)0)->~Model(); } |
| 23 | }; |
| 24 | |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 25 | # if NDNBOOST_WORKAROUND(__GNUC__, <= 3) |
Jeff Thompson | ef2d5a4 | 2013-08-22 19:09:24 -0700 | [diff] [blame] | 26 | |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 27 | # define NDNBOOST_CONCEPT_USAGE(model) \ |
Jeff Thompson | ef2d5a4 | 2013-08-22 19:09:24 -0700 | [diff] [blame] | 28 | model(); /* at least 2.96 and 3.4.3 both need this :( */ \ |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 29 | NDNBOOST_CONCEPT_ASSERT((ndnboost::concepts::usage_requirements<model>)); \ |
Jeff Thompson | ef2d5a4 | 2013-08-22 19:09:24 -0700 | [diff] [blame] | 30 | ~model() |
| 31 | |
| 32 | # else |
| 33 | |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 34 | # define NDNBOOST_CONCEPT_USAGE(model) \ |
| 35 | NDNBOOST_CONCEPT_ASSERT((ndnboost::concepts::usage_requirements<model>)); \ |
Jeff Thompson | ef2d5a4 | 2013-08-22 19:09:24 -0700 | [diff] [blame] | 36 | ~model() |
| 37 | |
| 38 | # endif |
| 39 | |
| 40 | # endif |
| 41 | |
| 42 | }} // namespace ndnboost::concepts |
| 43 | |
Jeff Thompson | 2491bd6 | 2013-10-15 17:10:24 -0700 | [diff] [blame] | 44 | #endif // NDNBOOST_CONCEPT_USAGE_NDNBOOST_DWA2006919_HPP |