mirror of
https://github.com/boostorg/config.git
synced 2025-07-30 04:17:16 +02:00
Remove BOOST_NO_EXPLICIT_FUNCTION_TEMPLATE_ARGUMENT
This makes boost::config independent of boost::core in the modularized repos. (from Stephen Kelly) Daniel James: The original patch included changes for several libraries. I'll deal with them later, they shouldn't break since the changes were to remove code that won't be activated any more. [SVN r85274]
This commit is contained in:
@ -392,24 +392,6 @@
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<p>
|
||||
<code class="computeroutput"><span class="identifier">BOOST_NO_EXPLICIT_FUNCTION_TEMPLATE_ARGUMENTS</span></code>
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
Compiler
|
||||
</p>
|
||||
</td>
|
||||
<td>
|
||||
<p>
|
||||
Can only use deduced template arguments when calling function template
|
||||
instantiations.
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<p>
|
||||
<code class="computeroutput"><span class="identifier">BOOST_NO_FUNCTION_TEMPLATE_ORDERING</span></code>
|
||||
|
@ -105,10 +105,6 @@ indeed doing so may be impossible in some cases. Those libraries that do
|
||||
honor this will typically abort if a critical error occurs - you have been
|
||||
warned!
|
||||
]]
|
||||
[[`BOOST_NO_EXPLICIT_FUNCTION_TEMPLATE_ARGUMENTS`][Compiler][
|
||||
Can only use deduced template arguments when calling function template
|
||||
instantiations.
|
||||
]]
|
||||
[[`BOOST_NO_FUNCTION_TEMPLATE_ORDERING`][Compiler][
|
||||
The compiler does not perform function template ordering or its function
|
||||
template ordering is incorrect.
|
||||
|
@ -503,69 +503,8 @@ namespace boost{
|
||||
#endif
|
||||
|
||||
// BOOST_[APPEND_]EXPLICIT_TEMPLATE_[NON_]TYPE macros --------------------------//
|
||||
//
|
||||
// Some compilers have problems with function templates whose template
|
||||
// parameters don't appear in the function parameter list (basically
|
||||
// they just link one instantiation of the template in the final
|
||||
// executable). These macros provide a uniform way to cope with the
|
||||
// problem with no effects on the calling syntax.
|
||||
|
||||
// Example:
|
||||
//
|
||||
// #include <iostream>
|
||||
// #include <ostream>
|
||||
// #include <typeinfo>
|
||||
//
|
||||
// template <int n>
|
||||
// void f() { std::cout << n << ' '; }
|
||||
//
|
||||
// template <typename T>
|
||||
// void g() { std::cout << typeid(T).name() << ' '; }
|
||||
//
|
||||
// int main() {
|
||||
// f<1>();
|
||||
// f<2>();
|
||||
//
|
||||
// g<int>();
|
||||
// g<double>();
|
||||
// }
|
||||
//
|
||||
// With VC++ 6.0 the output is:
|
||||
//
|
||||
// 2 2 double double
|
||||
//
|
||||
// To fix it, write
|
||||
//
|
||||
// template <int n>
|
||||
// void f(BOOST_EXPLICIT_TEMPLATE_NON_TYPE(int, n)) { ... }
|
||||
//
|
||||
// template <typename T>
|
||||
// void g(BOOST_EXPLICIT_TEMPLATE_TYPE(T)) { ... }
|
||||
//
|
||||
|
||||
|
||||
#if defined(BOOST_NO_EXPLICIT_FUNCTION_TEMPLATE_ARGUMENTS) && defined(__cplusplus)
|
||||
|
||||
# include "boost/type.hpp"
|
||||
# include "boost/non_type.hpp"
|
||||
|
||||
# define BOOST_EXPLICIT_TEMPLATE_TYPE(t) boost::type<t>* = 0
|
||||
# define BOOST_EXPLICIT_TEMPLATE_TYPE_SPEC(t) boost::type<t>*
|
||||
# define BOOST_EXPLICIT_TEMPLATE_NON_TYPE(t, v) boost::non_type<t, v>* = 0
|
||||
# define BOOST_EXPLICIT_TEMPLATE_NON_TYPE_SPEC(t, v) boost::non_type<t, v>*
|
||||
|
||||
# define BOOST_APPEND_EXPLICIT_TEMPLATE_TYPE(t) \
|
||||
, BOOST_EXPLICIT_TEMPLATE_TYPE(t)
|
||||
# define BOOST_APPEND_EXPLICIT_TEMPLATE_TYPE_SPEC(t) \
|
||||
, BOOST_EXPLICIT_TEMPLATE_TYPE_SPEC(t)
|
||||
# define BOOST_APPEND_EXPLICIT_TEMPLATE_NON_TYPE(t, v) \
|
||||
, BOOST_EXPLICIT_TEMPLATE_NON_TYPE(t, v)
|
||||
# define BOOST_APPEND_EXPLICIT_TEMPLATE_NON_TYPE_SPEC(t, v) \
|
||||
, BOOST_EXPLICIT_TEMPLATE_NON_TYPE_SPEC(t, v)
|
||||
|
||||
#else
|
||||
|
||||
// no workaround needed: expand to nothing
|
||||
// These macros are obsolete. Port away and remove.
|
||||
|
||||
# define BOOST_EXPLICIT_TEMPLATE_TYPE(t)
|
||||
# define BOOST_EXPLICIT_TEMPLATE_TYPE_SPEC(t)
|
||||
@ -577,9 +516,6 @@ namespace boost{
|
||||
# define BOOST_APPEND_EXPLICIT_TEMPLATE_NON_TYPE(t, v)
|
||||
# define BOOST_APPEND_EXPLICIT_TEMPLATE_NON_TYPE_SPEC(t, v)
|
||||
|
||||
|
||||
#endif // defined BOOST_NO_EXPLICIT_FUNCTION_TEMPLATE_ARGUMENTS
|
||||
|
||||
// When BOOST_NO_STD_TYPEINFO is defined, we can just import
|
||||
// the global definition into std namespace:
|
||||
#if defined(BOOST_NO_STD_TYPEINFO) && defined(__cplusplus)
|
||||
|
Reference in New Issue
Block a user