Multi-user gravity beats for Sound of Science 2013 (server)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.
 
 

19 lines
327 B

#pragma once
#include "json.h"
struct Identity{
template <typename T>
T operator()(T t){
return t;
}
};
template <typename C, typename F = Identity>
inline js::Value vector_to_json(C const & container, F f = Identity()){
js::Array array;
for(auto x : container){
array.push_back(to_json(f(x)));
}
return array;
}