Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:43:30

0001 // Copyright Daniel Wallin, David Abrahams 2005.
0002 // Copyright Cromwell D. Enage 2017.
0003 // Distributed under the Boost Software License, Version 1.0.
0004 // (See accompanying file LICENSE_1_0.txt or copy at
0005 // http://www.boost.org/LICENSE_1_0.txt)
0006 
0007 #ifndef BOOST_PARAMETER_KEYWORD_HPP
0008 #define BOOST_PARAMETER_KEYWORD_HPP
0009 
0010 #include <boost/parameter/aux_/tag.hpp>
0011 #include <boost/parameter/aux_/default.hpp>
0012 #include <boost/parameter/keyword_fwd.hpp>
0013 #include <boost/parameter/config.hpp>
0014 
0015 #if defined(BOOST_PARAMETER_HAS_PERFECT_FORWARDING)
0016 #include <boost/core/enable_if.hpp>
0017 #include <utility>
0018 
0019 #if defined(BOOST_PARAMETER_CAN_USE_MP11)
0020 #include <boost/mp11/integral.hpp>
0021 #include <boost/mp11/utility.hpp>
0022 #include <type_traits>
0023 #else
0024 #include <boost/mpl/bool.hpp>
0025 #include <boost/mpl/if.hpp>
0026 #include <boost/mpl/eval_if.hpp>
0027 #include <boost/type_traits/is_same.hpp>
0028 #include <boost/type_traits/is_scalar.hpp>
0029 #include <boost/type_traits/is_const.hpp>
0030 #endif
0031 
0032 namespace boost { namespace parameter {
0033 
0034     // Instances of unique specializations of keyword<...> serve to
0035     // associate arguments with parameter names.  For example:
0036     //
0037     //     struct rate_;             // parameter names
0038     //     struct skew_;
0039     //
0040     //     namespace
0041     //     {
0042     //         keyword<rate_> rate;  // keywords
0043     //         keyword<skew_> skew;
0044     //     }
0045     //
0046     //     ...
0047     //
0048     //     f(rate = 1, skew = 2.4);
0049     template <typename Tag>
0050     struct keyword
0051     {
0052         typedef Tag tag;
0053 
0054         inline BOOST_CONSTEXPR keyword()
0055         {
0056         }
0057 
0058         template <typename T>
0059         inline BOOST_CONSTEXPR typename ::boost::lazy_enable_if<
0060 #if defined(BOOST_PARAMETER_CAN_USE_MP11)
0061             ::boost::mp11::mp_if<
0062                 ::std::is_scalar<T>
0063               , ::boost::mp11::mp_true
0064               , ::boost::mp11::mp_if<
0065                     ::std::is_same<
0066                         typename Tag::qualifier
0067                       , ::boost::parameter::in_reference
0068                     >
0069                   , ::boost::mp11::mp_true
0070                   , ::std::is_same<
0071                         typename Tag::qualifier
0072                       , ::boost::parameter::forward_reference
0073                     >
0074                 >
0075             >
0076 #else   // !defined(BOOST_PARAMETER_CAN_USE_MP11)
0077             typename ::boost::mpl::eval_if<
0078                 ::boost::is_scalar<T>
0079               , ::boost::mpl::true_
0080               , ::boost::mpl::eval_if<
0081                     ::boost::is_same<
0082                         typename Tag::qualifier
0083                       , ::boost::parameter::in_reference
0084                     >
0085                   , ::boost::mpl::true_
0086                   , ::boost::mpl::if_<
0087                         ::boost::is_same<
0088                             typename Tag::qualifier
0089                           , ::boost::parameter::forward_reference
0090                         >
0091                       , ::boost::mpl::true_
0092                       , ::boost::mpl::false_
0093                     >
0094                 >
0095             >::type
0096 #endif  // BOOST_PARAMETER_CAN_USE_MP11
0097           , ::boost::parameter::aux::tag<Tag,T const&>
0098         >::type
0099             operator=(T const& x) const
0100         {
0101             typedef typename ::boost::parameter::aux
0102             ::tag<Tag,T const&>::type result;
0103             return result(x);
0104         }
0105 
0106         template <typename Default>
0107         inline BOOST_CONSTEXPR typename ::boost::enable_if<
0108 #if defined(BOOST_PARAMETER_CAN_USE_MP11)
0109             ::boost::mp11::mp_if<
0110                 ::std::is_scalar<Default>
0111               , ::boost::mp11::mp_true
0112               , ::boost::mp11::mp_if<
0113                     ::std::is_same<
0114                         typename Tag::qualifier
0115                       , ::boost::parameter::in_reference
0116                     >
0117                   , ::boost::mp11::mp_true
0118                   , ::std::is_same<
0119                         typename Tag::qualifier
0120                       , ::boost::parameter::forward_reference
0121                     >
0122                 >
0123             >
0124 #else   // !defined(BOOST_PARAMETER_CAN_USE_MP11)
0125             typename ::boost::mpl::eval_if<
0126                 ::boost::is_scalar<Default>
0127               , ::boost::mpl::true_
0128               , ::boost::mpl::eval_if<
0129                     ::boost::is_same<
0130                         typename Tag::qualifier
0131                       , ::boost::parameter::in_reference
0132                     >
0133                   , ::boost::mpl::true_
0134                   , ::boost::mpl::if_<
0135                         ::boost::is_same<
0136                             typename Tag::qualifier
0137                           , ::boost::parameter::forward_reference
0138                         >
0139                       , ::boost::mpl::true_
0140                       , ::boost::mpl::false_
0141                     >
0142                 >
0143             >::type
0144 #endif  // BOOST_PARAMETER_CAN_USE_MP11
0145           , ::boost::parameter::aux::default_<Tag,Default const>
0146         >::type
0147             operator|(Default const& d) const
0148         {
0149             return ::boost::parameter::aux::default_<Tag,Default const>(d);
0150         }
0151 
0152         template <typename T>
0153         inline BOOST_CONSTEXPR typename ::boost::lazy_enable_if<
0154 #if defined(BOOST_PARAMETER_CAN_USE_MP11)
0155             ::boost::mp11::mp_if<
0156                 ::boost::mp11::mp_if<
0157                     ::std::is_same<
0158                         typename Tag::qualifier
0159                       , ::boost::parameter::out_reference
0160                     >
0161                   , ::boost::mp11::mp_true
0162                   , ::std::is_same<
0163                         typename Tag::qualifier
0164                       , ::boost::parameter::forward_reference
0165                     >
0166                 >
0167               , ::boost::mp11::mp_if<
0168                     ::std::is_const<T>
0169                   , ::boost::mp11::mp_false
0170                   , ::boost::mp11::mp_true
0171                 >
0172               , ::boost::mp11::mp_false
0173             >
0174 #else   // !defined(BOOST_PARAMETER_CAN_USE_MP11)
0175             typename ::boost::mpl::eval_if<
0176                 typename ::boost::mpl::if_<
0177                     ::boost::is_same<
0178                         typename Tag::qualifier
0179                       , ::boost::parameter::out_reference
0180                     >
0181                   , ::boost::mpl::true_
0182                   , ::boost::is_same<
0183                         typename Tag::qualifier
0184                       , ::boost::parameter::forward_reference
0185                     >
0186                 >::type
0187               , ::boost::mpl::if_<
0188                     ::boost::is_const<T>
0189                   , ::boost::mpl::false_
0190                   , ::boost::mpl::true_
0191                 >
0192               , ::boost::mpl::false_
0193             >::type
0194 #endif  // BOOST_PARAMETER_CAN_USE_MP11
0195           , ::boost::parameter::aux::tag<Tag,T&>
0196         >::type
0197             operator=(T& x) const
0198         {
0199             typedef typename ::boost::parameter::aux
0200             ::tag<Tag,T&>::type result;
0201             return result(x);
0202         }
0203 
0204         template <typename Default>
0205         inline BOOST_CONSTEXPR typename ::boost::enable_if<
0206 #if defined(BOOST_PARAMETER_CAN_USE_MP11)
0207             ::boost::mp11::mp_if<
0208                 ::boost::mp11::mp_if<
0209                     ::std::is_same<
0210                         typename Tag::qualifier
0211                       , ::boost::parameter::out_reference
0212                     >
0213                   , ::boost::mp11::mp_true
0214                   , ::std::is_same<
0215                         typename Tag::qualifier
0216                       , ::boost::parameter::forward_reference
0217                     >
0218                 >
0219               , ::boost::mp11::mp_if<
0220                     ::std::is_const<Default>
0221                   , ::boost::mp11::mp_false
0222                   , ::boost::mp11::mp_true
0223                 >
0224               , ::boost::mp11::mp_false
0225             >
0226 #else   // !defined(BOOST_PARAMETER_CAN_USE_MP11)
0227             typename ::boost::mpl::eval_if<
0228                 typename ::boost::mpl::if_<
0229                     ::boost::is_same<
0230                         typename Tag::qualifier
0231                       , ::boost::parameter::out_reference
0232                     >
0233                   , ::boost::mpl::true_
0234                   , ::boost::is_same<
0235                         typename Tag::qualifier
0236                       , ::boost::parameter::forward_reference
0237                     >
0238                 >::type
0239               , ::boost::mpl::if_<
0240                     ::boost::is_const<Default>
0241                   , ::boost::mpl::false_
0242                   , ::boost::mpl::true_
0243                 >
0244               , ::boost::mpl::false_
0245             >::type
0246 #endif  // BOOST_PARAMETER_CAN_USE_MP11
0247           , ::boost::parameter::aux::default_<Tag,Default>
0248         >::type
0249             operator|(Default& d) const
0250         {
0251             return ::boost::parameter::aux::default_<Tag,Default>(d);
0252         }
0253 
0254         template <typename Default>
0255         inline BOOST_CONSTEXPR
0256         ::boost::parameter::aux::lazy_default<Tag,Default const>
0257             operator||(Default const& d) const
0258         {
0259             return ::boost::parameter::aux
0260             ::lazy_default<Tag,Default const>(d);
0261         }
0262 
0263         template <typename Default>
0264         inline BOOST_CONSTEXPR
0265         ::boost::parameter::aux::lazy_default<Tag,Default>
0266             operator||(Default& d) const
0267         {
0268             return ::boost::parameter::aux::lazy_default<Tag,Default>(d);
0269         }
0270 
0271         template <typename T>
0272         inline BOOST_CONSTEXPR typename ::boost::lazy_enable_if<
0273 #if defined(BOOST_PARAMETER_CAN_USE_MP11)
0274             ::boost::mp11::mp_if<
0275                 ::std::is_scalar<T>
0276               , ::boost::mp11::mp_false
0277               , ::boost::mp11::mp_if<
0278                     ::std::is_same<
0279                         typename Tag::qualifier
0280                       , ::boost::parameter::in_reference
0281                     >
0282                   , ::boost::mp11::mp_true
0283                   , ::std::is_same<
0284                         typename Tag::qualifier
0285                       , ::boost::parameter::forward_reference
0286                     >
0287                 >
0288             >
0289 #else   // !defined(BOOST_PARAMETER_CAN_USE_MP11)
0290             typename ::boost::mpl::eval_if<
0291                 ::boost::is_scalar<T>
0292               , ::boost::mpl::false_
0293               , ::boost::mpl::eval_if<
0294                     ::boost::is_same<
0295                         typename Tag::qualifier
0296                       , ::boost::parameter::in_reference
0297                     >
0298                   , ::boost::mpl::true_
0299                   , ::boost::mpl::if_<
0300                         ::boost::is_same<
0301                             typename Tag::qualifier
0302                           , ::boost::parameter::forward_reference
0303                         >
0304                       , ::boost::mpl::true_
0305                       , ::boost::mpl::false_
0306                     >
0307                 >
0308             >::type
0309 #endif  // BOOST_PARAMETER_CAN_USE_MP11
0310           , ::boost::parameter::aux::tag<Tag,T const>
0311         >::type
0312             operator=(T const&& x) const
0313         {
0314             typedef typename ::boost::parameter::aux
0315             ::tag<Tag,T const>::type result;
0316             return result(::std::forward<T const>(x));
0317         }
0318 
0319         template <typename T>
0320         inline BOOST_CONSTEXPR typename ::boost::lazy_enable_if<
0321 #if defined(BOOST_PARAMETER_CAN_USE_MP11)
0322             ::boost::mp11::mp_if<
0323                 ::std::is_scalar<T>
0324               , ::boost::mp11::mp_false
0325               , ::boost::mp11::mp_if<
0326                     ::std::is_same<
0327                         typename Tag::qualifier
0328                       , ::boost::parameter::consume_reference
0329                     >
0330                   , ::boost::mp11::mp_true
0331                   , ::std::is_same<
0332                         typename Tag::qualifier
0333                       , ::boost::parameter::forward_reference
0334                     >
0335                 >
0336             >
0337 #else   // !defined(BOOST_PARAMETER_CAN_USE_MP11)
0338             typename ::boost::mpl::eval_if<
0339                 ::boost::is_scalar<T>
0340               , ::boost::mpl::false_
0341               , ::boost::mpl::eval_if<
0342                     ::boost::is_same<
0343                         typename Tag::qualifier
0344                       , ::boost::parameter::consume_reference
0345                     >
0346                   , ::boost::mpl::true_
0347                   , ::boost::mpl::if_<
0348                         ::boost::is_same<
0349                             typename Tag::qualifier
0350                           , ::boost::parameter::forward_reference
0351                         >
0352                       , ::boost::mpl::true_
0353                       , ::boost::mpl::false_
0354                     >
0355                 >
0356             >::type
0357 #endif  // BOOST_PARAMETER_CAN_USE_MP11
0358           , ::boost::parameter::aux::tag<Tag,T>
0359         >::type
0360             operator=(T&& x) const
0361         {
0362             typedef typename ::boost::parameter::aux::tag<Tag,T>::type result;
0363             return result(::std::forward<T>(x));
0364         }
0365 
0366         template <typename Default>
0367         inline BOOST_CONSTEXPR typename ::boost::enable_if<
0368 #if defined(BOOST_PARAMETER_CAN_USE_MP11)
0369             ::boost::mp11::mp_if<
0370                 ::std::is_scalar<Default>
0371               , ::boost::mp11::mp_false
0372               , ::boost::mp11::mp_if<
0373                     ::std::is_same<
0374                         typename Tag::qualifier
0375                       , ::boost::parameter::in_reference
0376                     >
0377                   , ::boost::mp11::mp_true
0378                   , ::std::is_same<
0379                         typename Tag::qualifier
0380                       , ::boost::parameter::forward_reference
0381                     >
0382                 >
0383             >
0384 #else   // !defined(BOOST_PARAMETER_CAN_USE_MP11)
0385             typename ::boost::mpl::eval_if<
0386                 ::boost::is_scalar<Default>
0387               , ::boost::mpl::false_
0388               , ::boost::mpl::eval_if<
0389                     ::boost::is_same<
0390                         typename Tag::qualifier
0391                       , ::boost::parameter::in_reference
0392                     >
0393                   , ::boost::mpl::true_
0394                   , ::boost::mpl::if_<
0395                         ::boost::is_same<
0396                             typename Tag::qualifier
0397                           , ::boost::parameter::forward_reference
0398                         >
0399                       , ::boost::mpl::true_
0400                       , ::boost::mpl::false_
0401                     >
0402                 >
0403             >::type
0404 #endif  // BOOST_PARAMETER_CAN_USE_MP11
0405           , ::boost::parameter::aux::default_r_<Tag,Default const>
0406         >::type
0407             operator|(Default const&& d) const
0408         {
0409             return ::boost::parameter::aux::default_r_<Tag,Default const>(
0410                 ::std::forward<Default const>(d)
0411             );
0412         }
0413 
0414         template <typename Default>
0415         inline BOOST_CONSTEXPR typename ::boost::enable_if<
0416 #if defined(BOOST_PARAMETER_CAN_USE_MP11)
0417             ::boost::mp11::mp_if<
0418                 ::std::is_scalar<Default>
0419               , ::boost::mp11::mp_false
0420               , ::boost::mp11::mp_if<
0421                     ::std::is_same<
0422                         typename Tag::qualifier
0423                       , ::boost::parameter::consume_reference
0424                     >
0425                   , ::boost::mp11::mp_true
0426                   , ::std::is_same<
0427                         typename Tag::qualifier
0428                       , ::boost::parameter::forward_reference
0429                     >
0430                 >
0431             >
0432 #else   // !defined(BOOST_PARAMETER_CAN_USE_MP11)
0433             typename ::boost::mpl::eval_if<
0434                 ::boost::is_scalar<Default>
0435               , ::boost::mpl::false_
0436               , ::boost::mpl::eval_if<
0437                     ::boost::is_same<
0438                         typename Tag::qualifier
0439                       , ::boost::parameter::consume_reference
0440                     >
0441                   , ::boost::mpl::true_
0442                   , ::boost::mpl::if_<
0443                         ::boost::is_same<
0444                             typename Tag::qualifier
0445                           , ::boost::parameter::forward_reference
0446                         >
0447                       , ::boost::mpl::true_
0448                       , ::boost::mpl::false_
0449                     >
0450                 >
0451             >::type
0452 #endif  // BOOST_PARAMETER_CAN_USE_MP11
0453           , ::boost::parameter::aux::default_r_<Tag,Default>
0454         >::type
0455             operator|(Default&& d) const
0456         {
0457             return ::boost::parameter::aux
0458             ::default_r_<Tag,Default>(::std::forward<Default>(d));
0459         }
0460 
0461      public: // Insurance against ODR violations
0462         // Users will need to define their keywords in header files.  To
0463         // prevent ODR violations, it's important that the keyword used in
0464         // every instantiation of a function template is the same object.
0465         // We provide a reference to a common instance of each keyword
0466         // object and prevent construction by users.
0467         static ::boost::parameter::keyword<Tag> const instance;
0468 
0469         // This interface is deprecated.
0470         static ::boost::parameter::keyword<Tag>& get()
0471         {
0472             return const_cast< ::boost::parameter::keyword<Tag>&>(instance);
0473         }
0474     };
0475 
0476     template <typename Tag>
0477     ::boost::parameter::keyword<Tag> const ::boost::parameter
0478     ::keyword<Tag>::instance = ::boost::parameter::keyword<Tag>();
0479 }} // namespace boost::parameter
0480 
0481 #else   // !defined(BOOST_PARAMETER_HAS_PERFECT_FORWARDING)
0482 
0483 #if !defined(BOOST_NO_SFINAE)
0484 #include <boost/mpl/bool.hpp>
0485 #include <boost/mpl/if.hpp>
0486 #include <boost/mpl/eval_if.hpp>
0487 #include <boost/core/enable_if.hpp>
0488 #include <boost/type_traits/is_same.hpp>
0489 #include <boost/type_traits/is_scalar.hpp>
0490 #include <boost/type_traits/is_const.hpp>
0491 #endif  // BOOST_NO_SFINAE
0492 
0493 namespace boost { namespace parameter {
0494 
0495     // Instances of unique specializations of keyword<...> serve to
0496     // associate arguments with parameter names.  For example:
0497     //
0498     //     struct rate_;             // parameter names
0499     //     struct skew_;
0500     //
0501     //     namespace
0502     //     {
0503     //         keyword<rate_> rate;  // keywords
0504     //         keyword<skew_> skew;
0505     //     }
0506     //
0507     //     ...
0508     //
0509     //     f(rate = 1, skew = 2.4);
0510     template <typename Tag>
0511     struct keyword
0512     {
0513         typedef Tag tag;
0514 
0515         inline BOOST_CONSTEXPR keyword()
0516         {
0517         }
0518 
0519         template <typename T>
0520 #if defined(BOOST_NO_SFINAE)
0521         inline typename ::boost::parameter::aux::tag<Tag,T const&>::type
0522 #else
0523         inline BOOST_CONSTEXPR typename ::boost::lazy_enable_if<
0524             typename ::boost::mpl::eval_if<
0525                 ::boost::is_scalar<T>
0526               , ::boost::mpl::true_
0527               , ::boost::mpl::eval_if<
0528                     ::boost::is_same<
0529                         typename Tag::qualifier
0530                       , ::boost::parameter::in_reference
0531                     >
0532                   , ::boost::mpl::true_
0533                   , ::boost::mpl::if_<
0534                         ::boost::is_same<
0535                             typename Tag::qualifier
0536                           , ::boost::parameter::forward_reference
0537                         >
0538                       , ::boost::mpl::true_
0539                       , ::boost::mpl::false_
0540                     >
0541                 >
0542             >::type
0543           , ::boost::parameter::aux::tag<Tag,T const&>
0544         >::type
0545 #endif  // BOOST_NO_SFINAE
0546             operator=(T const& x) const
0547         {
0548             typedef typename ::boost::parameter::aux
0549             ::tag<Tag,T const&>::type result;
0550             return result(x);
0551         }
0552 
0553         template <typename Default>
0554 #if defined(BOOST_NO_SFINAE)
0555         inline ::boost::parameter::aux::default_<Tag,Default const>
0556 #else
0557         inline BOOST_CONSTEXPR typename ::boost::enable_if<
0558             typename ::boost::mpl::eval_if<
0559                 ::boost::is_scalar<Default>
0560               , ::boost::mpl::true_
0561               , ::boost::mpl::eval_if<
0562                     ::boost::is_same<
0563                         typename Tag::qualifier
0564                       , ::boost::parameter::in_reference
0565                     >
0566                   , ::boost::mpl::true_
0567                   , ::boost::mpl::if_<
0568                         ::boost::is_same<
0569                             typename Tag::qualifier
0570                           , ::boost::parameter::forward_reference
0571                         >
0572                       , ::boost::mpl::true_
0573                       , ::boost::mpl::false_
0574                     >
0575                 >
0576             >::type
0577           , ::boost::parameter::aux::default_<Tag,Default const>
0578         >::type
0579 #endif  // BOOST_NO_SFINAE
0580             operator|(Default const& d) const
0581         {
0582             return ::boost::parameter::aux::default_<Tag,Default const>(d);
0583         }
0584 
0585         template <typename T>
0586 #if defined(BOOST_NO_SFINAE)
0587         inline typename ::boost::parameter::aux::tag<Tag,T&>::type
0588 #else
0589         inline BOOST_CONSTEXPR typename ::boost::lazy_enable_if<
0590             typename ::boost::mpl::eval_if<
0591                 typename ::boost::mpl::if_<
0592                     ::boost::is_same<
0593                         typename Tag::qualifier
0594                       , ::boost::parameter::out_reference
0595                     >
0596                   , ::boost::mpl::true_
0597                   , ::boost::is_same<
0598                         typename Tag::qualifier
0599                       , ::boost::parameter::forward_reference
0600                     >
0601                 >::type
0602               , ::boost::mpl::if_<
0603                     ::boost::is_const<T>
0604                   , ::boost::mpl::false_
0605                   , ::boost::mpl::true_
0606                 >
0607               , ::boost::mpl::false_
0608             >::type
0609           , ::boost::parameter::aux::tag<Tag,T&>
0610         >::type
0611 #endif  // BOOST_NO_SFINAE
0612             operator=(T& x) const
0613         {
0614             typedef typename ::boost::parameter::aux
0615             ::tag<Tag,T&>::type result;
0616             return result(x);
0617         }
0618 
0619         template <typename Default>
0620 #if defined(BOOST_NO_SFINAE)
0621         inline ::boost::parameter::aux::default_<Tag,Default>
0622 #else
0623         inline BOOST_CONSTEXPR typename ::boost::enable_if<
0624             typename ::boost::mpl::eval_if<
0625                 typename ::boost::mpl::if_<
0626                     ::boost::is_same<
0627                         typename Tag::qualifier
0628                       , ::boost::parameter::out_reference
0629                     >
0630                   , ::boost::mpl::true_
0631                   , ::boost::is_same<
0632                         typename Tag::qualifier
0633                       , ::boost::parameter::forward_reference
0634                     >
0635                 >::type
0636               , ::boost::mpl::if_<
0637                     ::boost::is_const<Default>
0638                   , ::boost::mpl::false_
0639                   , ::boost::mpl::true_
0640                 >
0641               , ::boost::mpl::false_
0642             >::type
0643           , ::boost::parameter::aux::default_<Tag,Default>
0644         >::type
0645 #endif  // BOOST_NO_SFINAE
0646             operator|(Default& d) const
0647         {
0648             return ::boost::parameter::aux::default_<Tag,Default>(d);
0649         }
0650 
0651         template <typename Default>
0652         inline BOOST_CONSTEXPR
0653         ::boost::parameter::aux::lazy_default<Tag,Default const>
0654             operator||(Default const& d) const
0655         {
0656             return ::boost::parameter::aux
0657             ::lazy_default<Tag,Default const>(d);
0658         }
0659 
0660         template <typename Default>
0661         inline BOOST_CONSTEXPR
0662         ::boost::parameter::aux::lazy_default<Tag,Default>
0663             operator||(Default& d) const
0664         {
0665             return ::boost::parameter::aux::lazy_default<Tag,Default>(d);
0666         }
0667 
0668      public: // Insurance against ODR violations
0669         // Users will need to define their keywords in header files.  To
0670         // prevent ODR violations, it's important that the keyword used in
0671         // every instantiation of a function template is the same object.
0672         // We provide a reference to a common instance of each keyword
0673         // object and prevent construction by users.
0674         static ::boost::parameter::keyword<Tag> const instance;
0675 
0676         // This interface is deprecated.
0677         static ::boost::parameter::keyword<Tag>& get()
0678         {
0679             return const_cast< ::boost::parameter::keyword<Tag>&>(instance);
0680         }
0681     };
0682 
0683     template <typename Tag>
0684     ::boost::parameter::keyword<Tag> const ::boost::parameter
0685     ::keyword<Tag>::instance = ::boost::parameter::keyword<Tag>();
0686 }} // namespace boost::parameter
0687 
0688 #endif  // BOOST_PARAMETER_HAS_PERFECT_FORWARDING
0689 
0690 #include <boost/parameter/aux_/name.hpp>
0691 #include <boost/preprocessor/stringize.hpp>
0692 
0693 // Reduces boilerplate required to declare and initialize keywords without
0694 // violating ODR.  Declares a keyword tag type with the given name in
0695 // namespace tag_namespace, and declares and initializes a reference in an
0696 // anonymous namespace to a singleton instance of that type.
0697 #if defined(BOOST_PARAMETER_CAN_USE_MP11)
0698 #define BOOST_PARAMETER_KEYWORD(tag_namespace, name)                         \
0699     namespace tag_namespace                                                  \
0700     {                                                                        \
0701         struct name                                                          \
0702         {                                                                    \
0703             static BOOST_CONSTEXPR char const* keyword_name()                \
0704             {                                                                \
0705                 return BOOST_PP_STRINGIZE(name);                             \
0706             }                                                                \
0707             using _ = BOOST_PARAMETER_TAG_PLACEHOLDER_TYPE(name);            \
0708             using _1 = _;                                                    \
0709             BOOST_PARAMETER_TAG_MP11_PLACEHOLDER_BINDING(binding_fn, name);  \
0710             BOOST_PARAMETER_TAG_MP11_PLACEHOLDER_VALUE(fn, name);            \
0711             using qualifier = ::boost::parameter::forward_reference;         \
0712         };                                                                   \
0713     }                                                                        \
0714     namespace                                                                \
0715     {                                                                        \
0716         ::boost::parameter::keyword<tag_namespace::name> const& name         \
0717             = ::boost::parameter::keyword<tag_namespace::name>::instance;    \
0718     }
0719 /**/
0720 #else   // !defined(BOOST_PARAMETER_CAN_USE_MP11)
0721 #define BOOST_PARAMETER_KEYWORD(tag_namespace, name)                         \
0722     namespace tag_namespace                                                  \
0723     {                                                                        \
0724         struct name                                                          \
0725         {                                                                    \
0726             static BOOST_CONSTEXPR char const* keyword_name()                \
0727             {                                                                \
0728                 return BOOST_PP_STRINGIZE(name);                             \
0729             }                                                                \
0730             typedef BOOST_PARAMETER_TAG_PLACEHOLDER_TYPE(name) _;            \
0731             typedef BOOST_PARAMETER_TAG_PLACEHOLDER_TYPE(name) _1;           \
0732             typedef ::boost::parameter::forward_reference qualifier;         \
0733         };                                                                   \
0734     }                                                                        \
0735     namespace                                                                \
0736     {                                                                        \
0737         ::boost::parameter::keyword<tag_namespace::name> const& name         \
0738             = ::boost::parameter::keyword<tag_namespace::name>::instance;    \
0739     }
0740 /**/
0741 #endif  // BOOST_PARAMETER_CAN_USE_MP11
0742 
0743 #endif  // include guard
0744