0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-12-26 15:33:54 +01:00

ircd::js: Disambiguate vector<value> initializer list constructor.

This commit is contained in:
Jason Volk 2016-10-27 22:57:35 -07:00
parent 7e18e32ce4
commit b9137fd475

View file

@ -68,15 +68,17 @@ struct vector<value>
handle(): JS::HandleValueArray{JS::HandleValueArray::empty()} {} handle(): JS::HandleValueArray{JS::HandleValueArray::empty()} {}
}; };
/*
// Construct vector from initializer list of raw `JS::Value` // Construct vector from initializer list of raw `JS::Value`
// ex: JS::Value a; vector foo {{ a, a, ... }}; // ex: JS::Value a; vector foo {{ a, a, ... }};
vector(const std::initializer_list<jsapi_type> &list) explicit vector(const std::initializer_list<jsapi_type> &list)
:JS::AutoVectorRooter<jsapi_type>{*cx} :JS::AutoVectorRooter<jsapi_type>{*cx}
{ {
reserve(list.size()); reserve(list.size());
for(auto &t : list) for(auto &t : list)
infallibleAppend(t); infallibleAppend(t);
} }
*/
// Construct from initializer list of our `struct value` wrapper // Construct from initializer list of our `struct value` wrapper
// ex: value a(1); vector foo {{ a, a, ... }}; // ex: value a(1); vector foo {{ a, a, ... }};
@ -85,7 +87,7 @@ struct vector<value>
{ {
reserve(list.size()); reserve(list.size());
for(auto &t : list) for(auto &t : list)
infallibleAppend(t.get()); infallibleAppend(t);
} }
// Construct from initializer list of any type passed through `struct value` ctor // Construct from initializer list of any type passed through `struct value` ctor