Added type fix for gcc/clang and tiny formating fixes.
This commit is contained in:
parent
fcca453223
commit
af1eba1b0e
@ -623,7 +623,7 @@ namespace chaiscript
|
|||||||
const std::vector<Boxed_Value> &from_vec = detail::Cast_Helper<const std::vector<Boxed_Value> &>::cast(t_bv, nullptr);
|
const std::vector<Boxed_Value> &from_vec = detail::Cast_Helper<const std::vector<Boxed_Value> &>::cast(t_bv, nullptr);
|
||||||
|
|
||||||
To vec;
|
To vec;
|
||||||
|
vec.reserve(from_vec.size());
|
||||||
for (const Boxed_Value &bv : from_vec) {
|
for (const Boxed_Value &bv : from_vec) {
|
||||||
vec.push_back(detail::Cast_Helper<typename To::value_type>::cast(bv, nullptr));
|
vec.push_back(detail::Cast_Helper<typename To::value_type>::cast(bv, nullptr));
|
||||||
}
|
}
|
||||||
@ -636,13 +636,15 @@ namespace chaiscript
|
|||||||
|
|
||||||
#ifndef CHAISCRIPT_MSVC_12
|
#ifndef CHAISCRIPT_MSVC_12
|
||||||
template<typename To>
|
template<typename To>
|
||||||
Type_Conversion initializer_list_conversion() {
|
Type_Conversion initializer_list_conversion()
|
||||||
|
{
|
||||||
auto func = [](const Boxed_Value &t_bv) -> Boxed_Value {
|
auto func = [](const Boxed_Value &t_bv) -> Boxed_Value {
|
||||||
const std::vector<Boxed_Value> &from_vec = detail::Cast_Helper<const std::vector<Boxed_Value> &>::cast(t_bv, nullptr);
|
const std::vector<Boxed_Value> &from_vec = detail::Cast_Helper<const std::vector<Boxed_Value> &>::cast(t_bv, nullptr);
|
||||||
|
|
||||||
std::vector<To::value_type> vec;
|
std::vector<typename To::value_type> vec;
|
||||||
vec.reserve(from_vec.size());
|
vec.reserve(from_vec.size());
|
||||||
for (const auto &bv : from_vec) {
|
for (const auto &bv : from_vec)
|
||||||
|
{
|
||||||
vec.push_back(detail::Cast_Helper<typename To::value_type>::cast(bv, nullptr));
|
vec.push_back(detail::Cast_Helper<typename To::value_type>::cast(bv, nullptr));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -928,7 +928,8 @@ TEST_CASE("Return initializer_list")
|
|||||||
CHECK(typeid(decltype(initlist)) == typeid(std::initializer_list<int>));
|
CHECK(typeid(decltype(initlist)) == typeid(std::initializer_list<int>));
|
||||||
}
|
}
|
||||||
|
|
||||||
bool initializer_list_of_enums_interface(std::initializer_list<Utility_Test_Numbers> initlist) {
|
bool initializer_list_of_enums_interface(std::initializer_list<Utility_Test_Numbers> initlist)
|
||||||
|
{
|
||||||
return initlist.size() == 3 && *initlist.begin() == THREE;
|
return initlist.size() == 3 && *initlist.begin() == THREE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user