Namespaces
Variants
Views
Actions

Difference between revisions of "cpp/concepts/constructible from"

From cppreference.com
< cpp‎ | concepts
(move page (P1754R1))
 
m (Added Spanish link)
Line 14: Line 14:
 
{{dsc end }}
 
{{dsc end }}
  
{{langlinks|ja|zh}}
+
{{langlinks|es|ja|zh}}

Revision as of 06:14, 28 August 2020

Defined in header <concepts>
template < class T, class... Args >

concept constructible_from =

  std::destructible<T> && std::is_constructible_v<T, Args...>;
(since C++20)

The constructible_from concept specifies that a variable of type T can be initialized with the given set of argument types Args....

See also

checks if a type has a constructor for specific arguments
(class template) [edit]