Movatterモバイル変換


[0]ホーム

URL:


cppreference.com
Namespaces
Variants
    Actions

      std::uses_allocator<std::stack>

      From cppreference.com
      <cpp‎ |container‎ |stack

      [edit template]
       
       
       
       
      Defined in header<stack>
      template<class T,class Container,class Alloc>

      struct uses_allocator<std::stack<T, Container>, Alloc>

         :std::uses_allocator<Container, Alloc>::type{};
      (since C++11)

      Provides a transparent specialization of thestd::uses_allocator type trait forstd::stack: the container adaptor uses allocator if and only if the underlying container does.

      Contents

      Inherited fromstd::integral_constant

      Member constants

      value
      [static]
      true
      (public static member constant)

      Member functions

      operator bool
      converts the object tobool, returnsvalue
      (public member function)
      operator()
      (C++14)
      returnsvalue
      (public member function)

      Member types

      Type Definition
      value_typebool
      typestd::integral_constant<bool, value>

      [edit]Example

      Run this code
      #include <memory>#include <stack> static_assert(std::uses_allocator<std::stack<int>,void>::value==false&&std::uses_allocator<std::stack<int>,std::allocator<int>>::value==true); int main(){}

      [edit]See also

      checks if the specified type supports uses-allocator construction
      (class template)[edit]
      Retrieved from "https://en.cppreference.com/mwiki/index.php?title=cpp/container/stack/uses_allocator&oldid=142342"

      [8]ページ先頭

      ©2009-2025 Movatter.jp