0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-09-30 04:38:52 +02: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()} {}
};
/*
// Construct vector from initializer list of raw `JS::Value`
// 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}
{
reserve(list.size());
for(auto &t : list)
infallibleAppend(t);
}
*/
// Construct from initializer list of our `struct value` wrapper
// ex: value a(1); vector foo {{ a, a, ... }};
@ -85,7 +87,7 @@ struct vector<value>
{
reserve(list.size());
for(auto &t : list)
infallibleAppend(t.get());
infallibleAppend(t);
}
// Construct from initializer list of any type passed through `struct value` ctor