is_constructible.pass.cpp revision b64f8b07c104c6cc986570ac8ee0ed16a9f23976
1//===----------------------------------------------------------------------===//
2//
3//                     The LLVM Compiler Infrastructure
4//
5// This file is dual licensed under the MIT and the University of Illinois Open
6// Source Licenses. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//
9
10// type_traits
11
12// template <class T, class... Args>
13//   struct is_constructible;
14
15#include <type_traits>
16
17#ifndef _LIBCPP_HAS_NO_ADVANCED_SFINAE
18
19struct A
20{
21    explicit A(int);
22    A(int, double);
23};
24
25#endif  // _LIBCPP_HAS_NO_ADVANCED_SFINAE
26
27int main()
28{
29#ifndef _LIBCPP_HAS_NO_ADVANCED_SFINAE
30
31    static_assert((std::is_constructible<int>::value), "");
32    static_assert((std::is_constructible<int, const int>::value), "");
33    static_assert((std::is_constructible<A, int>::value), "");
34    static_assert((std::is_constructible<A, int, double>::value), "");
35    static_assert((!std::is_constructible<A>::value), "");
36
37#endif  // _LIBCPP_HAS_NO_ADVANCED_SFINAE
38}
39