fix std::out_of_range calls to use real constructors
authorYiding Jia <yiding@fb.com>
Thu, 29 Nov 2012 22:03:25 +0000 (14:03 -0800)
committerJordan DeLong <jdelong@fb.com>
Sun, 16 Dec 2012 22:46:02 +0000 (14:46 -0800)
Summary:
curiously, std::out_of_range doesn't have a zero-argument constructor according
to the spec. This was causing issues in my clang setup...

Test Plan: compiles.

Reviewed By: delong.j@fb.com

FB internal diff: D643363

folly/small_vector.h

index 5f7e27333dc6be1146bcbd7b9aa8e96d26770156..4a0fa276f3ab1a469582447bdb8b3b054aaaa9fa 100644 (file)
@@ -846,14 +846,14 @@ public:
 
   reference at(size_type i) {
     if (i >= size()) {
-      throw std::out_of_range();
+      throw std::out_of_range("index out of range");
     }
     return (*this)[i];
   }
 
   const_reference at(size_type i) const {
     if (i >= size()) {
-      throw std::out_of_range();
+      throw std::out_of_range("index out of range");
     }
     return (*this)[i];
   }