Code quality: more cleaning of files architecture

This commit is contained in:
Philippe Tillet
2015-08-06 19:34:26 -07:00
parent 0f0946b7a7
commit 33fea11547
57 changed files with 106 additions and 115 deletions

30
lib/external/rapidjson/to_array.hpp vendored Normal file
View File

@@ -0,0 +1,30 @@
#ifndef ISAAC_RAPIDJSON_TO_ARRAY_HPP
#define ISAAC_RAPIDJSON_TO_ARRAY_HPP
#include <vector>
#include "rapidjson/document.h"
namespace rapidjson
{
template<class T>
std::vector<T> to_int_array(rapidjson::Value const & a)
{
size_t N = a.Size();
std::vector<T> res(N);
for(size_t i = 0 ; i < N ; ++i) res[i] = a[i].GetInt();
return res;
}
template<class T>
std::vector<T> to_float_array(rapidjson::Value const & a)
{
size_t N = a.Size();
std::vector<T> res(N);
for(size_t i = 0 ; i < N ; ++i) res[i] = a[i].GetDouble();
return res;
}
}
#endif