什么是std::length_error異常
長度錯誤。它報告由於試圖超出某些對象的實現定義的長度限制而導致的錯誤。一般由std::basic_string和std::vector::reserve等成員函數拋出。
繼承關系
異常結構填充
ExceptionAddress: 747cc5af (KERNELBASE!RaiseException+0x00000058)
ExceptionCode: e06d7363 (C++ EH exception)
ExceptionFlags: 00000001
NumberParameters: 3
Parameter[0]: 19930520
Parameter[1]: 0039a178//std::length_error對象指針
Parameter[2]: 66805744
0:000> dt std::length_error 0039a178
DIYHome!std::length_error
+0x000 __VFN_table : 0x667c147c
+0x004 _Mywhat : 0x154882d8 "vector<T> too long"
+0x008 _Mydofree
備注
這個異常既不是內存不夠,也不是越界,而是要生成的容器size超過了容器最大值(max_size())而引發。當然引起超過最大值的原因就多種多樣了。