Skip to content

Commit 81c2ad4

Browse files
authored
Merge pull request #33 from aescande/topic/msvc
Compilation MSVC
2 parents f654fa9 + 4847ce7 commit 81c2ad4

File tree

6 files changed

+32
-24
lines changed

6 files changed

+32
-24
lines changed

include/proxsuite/linalg/veg/internal/fix_index.hpp

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -328,12 +328,10 @@ namespace adl {
328328

329329
inline namespace literals {
330330
template<char... Chars>
331-
VEG_INLINE constexpr auto operator"" _c()
332-
VEG_NOEXCEPT->Fix<_detail::parse_int(_detail::char_seq<Chars...>::value,
333-
sizeof...(Chars),
334-
_detail::Error{})>
331+
VEG_INLINE constexpr auto operator"" _c() VEG_NOEXCEPT
335332
{
336-
return {};
333+
return Fix<_detail::parse_int(
334+
_detail::char_seq<Chars...>::value, sizeof...(Chars), _detail::Error{})>{};
337335
}
338336
} // namespace literals
339337
} // namespace veg

include/proxsuite/linalg/veg/internal/macros.hpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -335,12 +335,13 @@
335335
noexcept->::proxsuite::linalg::veg::meta::true_type
336336

337337
#define __VEG_IMPL_SFINAE(_, Param) \
338-
, ::proxsuite::linalg::veg::meta::enable_if_t<__VEG_PP_UNWRAP Param, int> = 0
338+
, ::proxsuite::linalg::veg::meta:: \
339+
enable_if_t<__VEG_PP_ID(__VEG_PP_UNWRAP Param), int> = 0
339340

340341
#define __VEG_IMPL_OVERLOAD(Name_Tpl, Param) \
341342
template<__VEG_PP_REMOVE_PAREN(__VEG_PP_TAIL Name_Tpl), \
342343
typename ::proxsuite::linalg::veg::_detail::_meta:: \
343-
enable_if<__VEG_PP_UNWRAP Param, int>::type = 0> \
344+
enable_if<__VEG_PP_ID(__VEG_PP_UNWRAP Param), int>::type = 0> \
344345
auto __VEG_PP_CAT(check_, __VEG_PP_HEAD Name_Tpl)() noexcept \
345346
->::proxsuite::linalg::veg::meta::true_type;
346347

include/proxsuite/linalg/veg/internal/preprocessor.hpp

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -120,8 +120,9 @@
120120
#define __VEG_PP_IS_1(X) __VEG_IMPL_PP_IS_1_I(X)
121121
#define __VEG_PP_IS_0(X) __VEG_PP_IS_1(__VEG_IMPL_PP_INC_I(X))
122122

123+
#define __VEG_PP_ID(X) X
123124

124-
#define __VEG_IMPL_PP_VARIADIC_SIZE(...) __VEG_IMPL_PP_COUNT(__VA_ARGS__, 32, 31, 30, 29, 28, 27, 26, 25, 24, 23, 22, 21, 20, 19, 18, 17, 16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0)
125+
#define __VEG_IMPL_PP_VARIADIC_SIZE(...) __VEG_PP_ID(__VEG_IMPL_PP_COUNT(__VA_ARGS__, 32, 31, 30, 29, 28, 27, 26, 25, 24, 23, 22, 21, 20, 19, 18, 17, 16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0))
125126

126127
#define __VEG_IMPL_PP_MAKE_TUPLE0 ()
127128
#define __VEG_IMPL_PP_MAKE_TUPLE1 (0)
@@ -402,7 +403,8 @@
402403
__VEG_IMPL_PP_IS_1(__VEG_PP_TUPLE_SIZE(Tuple))) \
403404
(Macro, Data, Tuple)
404405

405-
#define __VEG_PP_TUPLE_SIZE(Tuple) __VEG_IMPL_PP_VARIADIC_SIZE Tuple
406+
#define __VEG_PP_TUPLE_SIZE(Tuple) \
407+
__VEG_PP_ID(__VEG_IMPL_PP_VARIADIC_SIZE Tuple)
406408
#define __VEG_PP_SEQ_HEAD(Seq) \
407409
__VEG_IMPL_PP_SEQ_HEAD_0 Seq)
408410
#define __VEG_PP_SEQ_TAIL(Seq) __VEG_IMPL_PP_CONSUME Seq
@@ -421,9 +423,12 @@
421423
#define __VEG_PP_CAT2(A, ...) __VEG_IMPL_PP_CAT2(A, __VA_ARGS__)
422424
#define __VEG_PP_CAT3(A, ...) __VEG_IMPL_PP_CAT3(A, __VA_ARGS__)
423425
#define __VEG_PP_REMOVE_PAREN(...) \
424-
__VEG_IMPL_PP_REMOVE_PAREN2(__VEG_IMPL_PP_REMOVE_PAREN1 __VA_ARGS__)
426+
__VEG_IMPL_PP_REMOVE_PAREN2( \
427+
__VEG_PP_ID(__VEG_IMPL_PP_REMOVE_PAREN1 __VA_ARGS__))
425428
#define __VEG_PP_REMOVE_PAREN1(...) \
426-
__VEG_IMPL_PP_REMOVE_PAREN21(__VEG_IMPL_PP_REMOVE_PAREN11 __VA_ARGS__)
427-
#define __VEG_PP_UNWRAP(...) __VEG_PP_HEAD __VA_ARGS__ __VEG_PP_TAIL __VA_ARGS__
429+
__VEG_IMPL_PP_REMOVE_PAREN21( \
430+
__VEG_PP_ID(__VEG_IMPL_PP_REMOVE_PAREN11 __VA_ARGS__))
431+
#define __VEG_PP_UNWRAP(...) \
432+
__VEG_PP_ID(__VEG_PP_HEAD __VA_ARGS__ __VEG_PP_TAIL __VA_ARGS__)
428433

429434
#endif /* end of include guard VEG_PREPROCESSOR_HPP_U2V3WRWYS */

include/proxsuite/linalg/veg/memory/dynamic_stack.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ max2(isize a, isize b) noexcept -> isize
2525
constexpr auto
2626
round_up_pow2(isize a, isize b) noexcept -> isize
2727
{
28-
return isize((usize(a) + ~-usize(b)) & -usize(b));
28+
return isize((usize(a) + ~(0 - usize(b))) & (0 - usize(b)));
2929
}
3030
} // namespace _dynstack
3131
} // namespace _detail

include/proxsuite/linalg/veg/slice.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ template<typename T, isize N>
187187
struct Array
188188
{
189189
static_assert(N > 0, ".");
190-
T _[usize{ N }];
190+
T _[static_cast<usize>(N)];
191191

192192
constexpr auto as_ref() const -> Slice<T>
193193
{

include/proxsuite/linalg/veg/tuple.hpp

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -394,34 +394,38 @@ struct IndexedTuple<meta::index_sequence<Is...>, Ts...>
394394
void operator[](Fix<I> /*arg*/) const&& = delete;
395395

396396
VEG_TEMPLATE((isize I),
397-
requires(usize{ I } < sizeof...(Ts)),
397+
requires(static_cast<usize>(I) < sizeof...(Ts)),
398398
VEG_NODISCARD VEG_INLINE VEG_CPP14(constexpr) auto
399399
operator[],
400400
(/*arg*/, Fix<I>)) &&
401-
VEG_NOEXCEPT_IF(VEG_CONCEPT(nothrow_movable<ith<usize{ I }, Ts...>>))
402-
-> ith<usize{ I }, Ts...>
401+
VEG_NOEXCEPT_IF(
402+
VEG_CONCEPT(nothrow_movable<ith<static_cast<usize>(I), Ts...>>))
403+
-> ith<static_cast<usize>(I), Ts...>
403404
{
404-
return __VEG_IMPL_LEAF_ONCE(*this, usize{ I }, ith<usize{ I }, Ts...>);
405+
return __VEG_IMPL_LEAF_ONCE(
406+
*this, static_cast<usize>(I), ith<static_cast<usize>(I), Ts...>);
405407
}
406408

407409
VEG_TEMPLATE((isize I),
408-
requires(usize{ I } < sizeof...(Ts)),
410+
requires(static_cast<usize>(I) < sizeof...(Ts)),
409411
VEG_NODISCARD VEG_INLINE VEG_CPP14(constexpr) auto
410412
operator[],
411413
(/*arg*/, Fix<I>)) &
412-
VEG_NOEXCEPT->ith<usize{ I }, Ts...>&
414+
VEG_NOEXCEPT->ith<static_cast<usize>(I), Ts...>&
413415
{
414-
return __VEG_IMPL_LEAF_MUT(*this, usize{ I }, ith<usize{ I }, Ts...>);
416+
return __VEG_IMPL_LEAF_MUT(
417+
*this, static_cast<usize>(I), ith<static_cast<usize>(I), Ts...>);
415418
}
416419

417420
VEG_TEMPLATE((isize I),
418-
requires(usize{ I } < sizeof...(Ts)),
421+
requires(static_cast<usize>(I) < sizeof...(Ts)),
419422
VEG_NODISCARD VEG_INLINE VEG_CPP14(constexpr) auto
420423
operator[],
421424
(/*arg*/, Fix<I>))
422-
const & VEG_NOEXCEPT->ith<usize{ I }, Ts...> const&
425+
const & VEG_NOEXCEPT->ith<static_cast<usize>(I), Ts...> const&
423426
{
424-
return __VEG_IMPL_LEAF(*this, usize{ I }, ith<usize{ I }, Ts...>);
427+
return __VEG_IMPL_LEAF(
428+
*this, static_cast<usize>(I), ith<static_cast<usize>(I), Ts...>);
425429
}
426430
};
427431
} // namespace tuple

0 commit comments

Comments
 (0)