std::allocator_traits::max_size

定义于头文件 <memory>
static size_type max_size( const Alloc& a );
(C++11 起)

若可能,则从 a 获得最大理论可行的分配大小,通过调用

a.max_size()

若上述者不可行(例如 a 无成员函数 max_size() ),则返回 std::numeric_limits<size_type>::max() (C++17 前)std::numeric_limits<size_type>::max() / sizeof(value_type) (C++17 起)

目录

参数

(无)

返回值

理论最大分配大小

异常

noexcept 规定:  
noexcept
  

参阅

(C++17 中弃用)
返回最大的受支持分配大小
(std::allocator 的公开成员函数)

版本历史

  • (当前 | 先前 2017年6月4日 (日) 19:31Fruderica讨论 | 贡献. . (817字节) (-462). . (撤销)
  • 当前 | 先前 2013年7月2日 (二) 09:02P12bot讨论 | 贡献 . . (1,279字节) (-25). . (Use {{lc}}. Update links. Various fixes.) (撤销)
  • 当前 | 先前 2012年11月2日 (五) 16:44P12bot讨论 | 贡献 . . (1,304字节) (+353). . (r2.7.3) (机器人添加:de, en, es, fr, it, ja, pt, ru) (撤销)
  • 当前 | 先前 2012年10月27日 (六) 03:25P12讨论 | 贡献 . . (951字节) (0). . (1个修订: Translate from the English version) (撤销)
  • 当前 | 先前 2012年10月26日 (五) 06:00TranslationBot讨论 | 贡献. . (951字节) (-45). . (Translated from the English version using Google Translate) (撤销)
  • 当前 | 先前 2012年10月25日 (四) 14:09P12讨论 | 贡献 . . (996字节) (0). . (1个修订: Translate from the English version) (撤销)
  • 当前 | 先前) 2012年10月25日 (四) 12:00TranslationBot讨论 | 贡献. . (996字节) (+996). . (Translated from the English version using Google Translate)