Implement n3789; constexpr support in named function objects

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@191626 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Marshall Clow
2013-09-28 19:06:12 +00:00
parent 6db12cb037
commit 9738cafa4f
21 changed files with 201 additions and 45 deletions

View File

@@ -27,5 +27,11 @@ int main()
assert(f2(3,2) == 6);
assert(f2(3.0, 2) == 6);
assert(f2(3, 2.5) == 7.5); // exact in binary
constexpr int foo = std::multiplies<int> () (3, 2);
static_assert ( foo == 6, "" );
constexpr int bar = std::multiplies<> () (3.0, 2);
static_assert ( bar == 6, "" );
#endif
}