-
Notifications
You must be signed in to change notification settings - Fork 45
Open
Description
To my understanding safe<> should work in any template as integer safety is orthogonal.
I am unable to use safe<int> in std::span in MSVC:
#include <span>
#include <vector>
#include <boost/safe_numerics/safe_integer.hpp>
using Int = boost::safe_numerics::safe<int>;
auto foo_safe(std::span<const Int> numbers) -> int {
return int {numbers[0]};
}
int main() {
const auto numbers = std::vector<Int> {
Int {1}, Int {2}, Int {3}
};
return foo_safe(numbers);
}
This leads to a recursive alias declaration error:
error C2968:
'legal_overload<boost::safe_numerics::addition_operator,std::_Vector_const_iterator<std::_Vector_val
<std::_Simple_types<boost::safe_numerics::safe_base<int,-2147483648,2147483647,boost::
safe_numerics::native,boost::safe_numerics::exception_policy<
boost::safe_numerics::throw_exception,boost::safe_numerics::throw_exception,boost::
safe_numerics::throw_exception,boost::safe_numerics::ignore_exception> > > > >,__int64>':
recursive alias declaration
Metadata
Metadata
Assignees
Labels
No labels