is_constructible.hpp 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. /* Copyright 2016-2017 Joaquin M Lopez Munoz.
  2. * Distributed under the Boost Software License, Version 1.0.
  3. * (See accompanying file LICENSE_1_0.txt or copy at
  4. * http://www.boost.org/LICENSE_1_0.txt)
  5. *
  6. * See http://www.boost.org/libs/poly_collection for library home page.
  7. */
  8. #ifndef BOOST_POLY_COLLECTION_DETAIL_IS_CONSTRUCIBLE_HPP
  9. #define BOOST_POLY_COLLECTION_DETAIL_IS_CONSTRUCIBLE_HPP
  10. #if defined(_MSC_VER)
  11. #pragma once
  12. #endif
  13. #include <boost/config.hpp>
  14. #include <boost/detail/workaround.hpp>
  15. #if BOOST_WORKAROUND(BOOST_MSVC_FULL_VER,<190023918)
  16. /* https://connect.microsoft.com/VisualStudio/Feedback/Details/2118677,
  17. * fixed in VS2015U2 according to
  18. * https://blogs.msdn.microsoft.com/vcblog/2016/03/31/
  19. * visual-c-2015-update-2-bug-fixes/, via github.com/dodheim
  20. */
  21. #include <boost/type_traits/is_constructible.hpp>
  22. namespace boost{
  23. namespace poly_collection{
  24. namespace detail{
  25. template<typename T,typename... Args>
  26. struct is_constructible:std::integral_constant<
  27. bool,
  28. boost::is_constructible<T,Args...>::value
  29. >{};
  30. } /* namespace poly_collection::detail */
  31. } /* namespace poly_collection */
  32. } /* namespace boost */
  33. #else
  34. #include <type_traits>
  35. namespace boost{
  36. namespace poly_collection{
  37. namespace detail{
  38. template<typename T,typename... Args>
  39. using is_constructible=std::is_constructible<T,Args...>;
  40. } /* namespace poly_collection::detail */
  41. } /* namespace poly_collection */
  42. } /* namespace boost */
  43. #endif
  44. #endif