nobind.hpp 1.0 KB

1234567891011121314151617181920212223242526272829303132
  1. // Copyright (C) 2009-2012 Lorenzo Caminiti
  2. // Distributed under the Boost Software License, Version 1.0
  3. // (see accompanying file LICENSE_1_0.txt or a copy at
  4. // http://www.boost.org/LICENSE_1_0.txt)
  5. // Home at http://www.boost.org/libs/local_function
  6. #ifndef BOOST_LOCAL_FUNCTION_AUX_NOBIND_HPP_
  7. #define BOOST_LOCAL_FUNCTION_AUX_NOBIND_HPP_
  8. #include <boost/local_function/config.hpp>
  9. // NOTE: The current implementation needs no-bind placeholders only when
  10. // local types cannot be passed as template parameters.
  11. #if !BOOST_LOCAL_FUNCTION_CONFIG_LOCALS_AS_TPARAMS
  12. namespace boost { namespace local_function { namespace aux {
  13. typedef int nobind_t; // Tag no-bind type.
  14. static nobind_t nobind; // Global variable so all no-binds can reference it.
  15. // NOTE: Used only to get rid of unused static variable `nobind` (this function
  16. // is never actually called so it does not need to be defined).
  17. void no_unused_nobind_warning_(nobind_t* ptr = &nobind);
  18. } } } // namespace
  19. #endif // locals as tparams
  20. #endif // #include guard