Skip to content

Commit

Permalink
[libc++] Mark the C++03 version of std::function as deprecated
Browse files Browse the repository at this point in the history
Summary: We want to eventually remove it.

Reviewers: EricWF

Subscribers: christof, jkorous, dexonsmith, libcxx-commits

Tags: #libc

Differential Revision: https://reviews.llvm.org/D74719
  • Loading branch information
ldionne committed Feb 24, 2020
1 parent 80e73f2 commit c008716
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions libcxx/include/__functional_03
Original file line number Diff line number Diff line change
Expand Up @@ -443,8 +443,15 @@ __func<_Fp, _Alloc, _Rp(_A0, _A1, _A2)>::target_type() const

} // __function

#if !defined(_LIBCPP_DISABLE_DEPRECATION_WARNINGS) && __has_attribute(deprecated)
# define _LIBCPP_DEPRECATED_CXX03_FUNCTION \
__attribute__((deprecated("Using std::function in C++03 is not supported anymore. Please upgrade to C++11 or later, or use a different type")))
#else
# define _LIBCPP_DEPRECATED_CXX03_FUNCTION /* nothing */
#endif

template<class _Rp>
class _LIBCPP_TEMPLATE_VIS function<_Rp()>
class _LIBCPP_DEPRECATED_CXX03_FUNCTION _LIBCPP_TEMPLATE_VIS function<_Rp()>
{
typedef __function::__base<_Rp()> __base;
aligned_storage<3*sizeof(void*)>::type __buf_;
Expand Down Expand Up @@ -723,7 +730,7 @@ function<_Rp()>::target() const
#endif // _LIBCPP_NO_RTTI

template<class _Rp, class _A0>
class _LIBCPP_TEMPLATE_VIS function<_Rp(_A0)>
class _LIBCPP_DEPRECATED_CXX03_FUNCTION _LIBCPP_TEMPLATE_VIS function<_Rp(_A0)>
: public unary_function<_A0, _Rp>
{
typedef __function::__base<_Rp(_A0)> __base;
Expand Down Expand Up @@ -1003,7 +1010,7 @@ function<_Rp(_A0)>::target() const
#endif // _LIBCPP_NO_RTTI

template<class _Rp, class _A0, class _A1>
class _LIBCPP_TEMPLATE_VIS function<_Rp(_A0, _A1)>
class _LIBCPP_DEPRECATED_CXX03_FUNCTION _LIBCPP_TEMPLATE_VIS function<_Rp(_A0, _A1)>
: public binary_function<_A0, _A1, _Rp>
{
typedef __function::__base<_Rp(_A0, _A1)> __base;
Expand Down Expand Up @@ -1283,7 +1290,7 @@ function<_Rp(_A0, _A1)>::target() const
#endif // _LIBCPP_NO_RTTI

template<class _Rp, class _A0, class _A1, class _A2>
class _LIBCPP_TEMPLATE_VIS function<_Rp(_A0, _A1, _A2)>
class _LIBCPP_DEPRECATED_CXX03_FUNCTION _LIBCPP_TEMPLATE_VIS function<_Rp(_A0, _A1, _A2)>
{
typedef __function::__base<_Rp(_A0, _A1, _A2)> __base;
aligned_storage<3*sizeof(void*)>::type __buf_;
Expand Down

0 comments on commit c008716

Please sign in to comment.