Skip to content

Commit 4ab2197

Browse files
committed
updated conversion for std::size_t in order to work with msvc
1 parent 8ec5025 commit 4ab2197

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

src/get_args.hpp

+12-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
#pragma once
22

3+
#include <iterator>
34
#include <stdexcept>
45
#include <string_view>
6+
#include <type_traits>
57

68
#include "param_info.hpp"
79
#include "value.hpp"
@@ -20,8 +22,16 @@ struct conversion
2022
template <typename T>
2123
operator T() const
2224
{
23-
return cuke::registry().get_expression(key).callback(begin + idx,
24-
values_count);
25+
// NOTE: MSVC treats std::size_t differently then mac/linux
26+
if constexpr (std::is_same_v<T, std::size_t>)
27+
{
28+
return make_parameter_value<std::size_t>(begin + idx, values_count);
29+
}
30+
else
31+
{
32+
return cuke::registry().get_expression(key).callback(begin + idx,
33+
values_count);
34+
}
2535
}
2636
};
2737

0 commit comments

Comments
 (0)