diff options
author | Paolo Carlini <paolo@gcc.gnu.org> | 2007-07-10 19:28:07 +0000 |
---|---|---|
committer | Paolo Carlini <paolo@gcc.gnu.org> | 2007-07-10 19:28:07 +0000 |
commit | f425a30a1ecc2f16f9b65d6af924c9a0d707a2eb (patch) | |
tree | 06b1ffda5e5db018f266a44d8f7a7ae85d42fe87 | |
parent | 558be301bddc36ccee1daf43d74c0a6296d3eb13 (diff) | |
download | gcc-f425a30a1ecc2f16f9b65d6af924c9a0d707a2eb.zip gcc-f425a30a1ecc2f16f9b65d6af924c9a0d707a2eb.tar.gz gcc-f425a30a1ecc2f16f9b65d6af924c9a0d707a2eb.tar.bz2 |
utility (identity, [...]): Add.
2007-07-10 Paolo Carlini <pcarlini@suse.de>
* include/std/utility (identity, move, forward): Add.
* testsuite/20_util/move/requirements/explicit_instantiation.cc: New.
* testsuite/20_util/move/1.cc: New.
* testsuite/20_util/identity/value.cc: New.
* testsuite/20_util/identity/requirements/typedefs.cc: New.
* testsuite/20_util/identity/requirements/explicit_instantiation.cc:
New.
* testsuite/20_util/forward/requirements/explicit_instantiation.cc:
New.
* testsuite/20_util/forward/1.cc: New.
* testsuite/20_util/forward/1_neg.cc: New.
From-SVN: r126524
-rw-r--r-- | libstdc++-v3/include/std/utility | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/libstdc++-v3/include/std/utility b/libstdc++-v3/include/std/utility index 21440e5..e9376dc 100644 --- a/libstdc++-v3/include/std/utility +++ b/libstdc++-v3/include/std/utility @@ -1,6 +1,7 @@ // <utility> -*- C++ -*- -// Copyright (C) 2001, 2002, 2006 Free Software Foundation, Inc. +// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007 +// Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the @@ -83,6 +84,29 @@ # undef _GLIBCXX_BEGIN_NAMESPACE_TR1 # undef _GLIBCXX_INCLUDE_AS_CXX0X # endif + +#include <type_traits> + +namespace std +{ + // 20.2.2, forward/move + template<typename _Tp> + struct identity + { + typedef _Tp type; + }; + + template<typename _Tp> + inline _Tp&& + forward(typename std::identity<_Tp>::type&& __t) + { return __t; } + + template<typename _Tp> + inline typename std::remove_reference<_Tp>::type&& + move(_Tp&& __t) + { return __t; } +} + #endif #endif /* _GLIBCXX_UTILITY */ |