Summary:
It appears that std::unordered_map is no longer relocatable in
gcc-4.7. Use std::vector instead, until fbvector supports non-
relocatable types.
Test Plan: Built and ran facebar tests under gcc-4.7. Also ran folly unittests.
Reviewed By: andrei.alexandrescu@fb.com
FB internal diff:
D543099
}
inline dynamic::const_iterator dynamic::erase(const_iterator it) {
}
inline dynamic::const_iterator dynamic::erase(const_iterator it) {
- return get<Array>().erase(it);
+ auto& arr = get<Array>();
+ return get<Array>().erase(arr.begin() + (it - arr.begin()));
}
inline dynamic::const_iterator
dynamic::erase(const_iterator first, const_iterator last) {
}
inline dynamic::const_iterator
dynamic::erase(const_iterator first, const_iterator last) {
- return get<Array>().erase(first, last);
+ auto& arr = get<Array>();
+ return get<Array>().erase(
+ arr.begin() + (first - arr.begin()),
+ arr.begin() + (last - arr.begin()));
}
inline dynamic::const_key_iterator dynamic::erase(const_key_iterator it) {
}
inline dynamic::const_key_iterator dynamic::erase(const_key_iterator it) {
#include <ostream>
#include <type_traits>
#include <initializer_list>
#include <ostream>
#include <type_traits>
#include <initializer_list>
#include <cstdint>
#include <boost/operators.hpp>
#include "folly/Traits.h"
#include <cstdint>
#include <boost/operators.hpp>
#include "folly/Traits.h"
-#include "folly/FBVector.h"
#include "folly/FBString.h"
namespace folly {
#include "folly/FBString.h"
namespace folly {
struct dynamic;
struct TypeError;
struct dynamic;
struct TypeError;
-template<> FOLLY_ASSUME_RELOCATABLE(dynamic);
//////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////
* Object item iterators dereference as pairs of (key, value).
*/
private:
* Object item iterators dereference as pairs of (key, value).
*/
private:
- typedef fbvector<dynamic> Array;
+ typedef std::vector<dynamic> Array;
public:
typedef Array::const_iterator const_iterator;
struct const_key_iterator;
public:
typedef Array::const_iterator const_iterator;
struct const_key_iterator;