Skip to content

Commit 799b173

Browse files
committed
fix(*): fixing msvc compile errors
1 parent 63cdc34 commit 799b173

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+379
-310
lines changed

include/stdsharp/array/array.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#pragma once
22

33
#include "../macros.h"
4+
#include "../namespace_alias.h"
45

56
#include <algorithm>
67
#include <array>

include/stdsharp/concepts/object.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,8 @@ namespace stdsharp
264264
};
265265

266266
template<typename T, typename U>
267-
concept decay_derived = std::is_base_of_v<std::remove_reference_t<U>, std::remove_reference_t<T>>;
267+
concept decay_derived =
268+
std::is_base_of_v<std::remove_reference_t<U>, std::remove_reference_t<T>>;
268269

269270
template<typename T, typename U>
270271
concept not_decay_derived = !decay_derived<T, U>;

include/stdsharp/containers/concepts.h

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -442,13 +442,16 @@ namespace stdsharp::details
442442
using size_t = std::size_t;
443443

444444
template<typename... Optional>
445-
static constexpr bool value = std::constructible_from<Container, Args..., Optional...> &&
446-
[]<size_t... I>(const std::index_sequence<I...>) consteval {
447-
return value<type_at<I, Optional...>...>;
448-
}(std::make_index_sequence<sizeof...(Optional) - 1>{});
445+
static constexpr bool value =
446+
[]<size_t... I>(this const auto self, const std::index_sequence<I...>) consteval
447+
{
448+
constexpr auto count = sizeof...(I);
449+
auto res = std::constructible_from<Container, Args..., type_at<I, Optional...>...>;
449450

450-
template<>
451-
static constexpr bool value<> = std::constructible_from<Container, Args...>;
451+
if constexpr(count > 0) res = res && self(std::make_index_sequence<count - 1>{});
452+
453+
return res;
454+
}(std::make_index_sequence<sizeof...(Optional)>{});
452455
};
453456
}
454457

include/stdsharp/default_operator.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,8 @@ namespace stdsharp::default_operator
9191
struct subscript
9292
{
9393
#if __cpp_multidimensional_subscript >= 202110L
94-
[[nodiscard]] constexpr decltype(auto) operator[](this auto&& t, auto&& first_arg, auto&&... args)
94+
[[nodiscard]] constexpr decltype(auto
95+
) operator[](this auto&& t, auto&& first_arg, auto&&... args)
9596
noexcept(noexcept(cpp_forward(t)[cpp_forward(first_arg)][cpp_forward(args)...]))
9697
requires requires {
9798
requires sizeof...(args) > 0;

include/stdsharp/exception/exception.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
#pragma once
22

3+
#include "../namespace_alias.h"
4+
35
#include <array>
46
#include <concepts>
57
#include <exception>

include/stdsharp/functional/always_return.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#pragma once
22

33
#include "../macros.h"
4+
#include "../namespace_alias.h"
45

56
#include <functional>
67

include/stdsharp/functional/bind_front.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#pragma once
22

33
#include "../macros.h"
4+
#include "../namespace_alias.h"
45

56
#include <functional>
67

include/stdsharp/functional/empty_invoke.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#pragma once
22

3-
#include "stdsharp/type_traits/object.h"
3+
#include "../type_traits/object.h"
44

55
namespace stdsharp
66
{

include/stdsharp/functional/forward_bind.h

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,7 @@ namespace stdsharp::details
1414
}
1515

1616
template<typename T, std::constructible_from<T> U = std::remove_cvref_t<T>>
17-
requires std::move_constructible<U>
18-
static constexpr auto forward(T&& t)
17+
static constexpr std::move_constructible auto forward(T&& t)
1918
noexcept(nothrow_constructible_from<U, T> && nothrow_move_constructible<U>)
2019
{
2120
return U{cpp_forward(t)};
@@ -27,7 +26,8 @@ namespace stdsharp::details
2726
template<typename T, typename ForwardT>
2827
static constexpr decltype(auto) get_forwarded(ForwardT&& t) noexcept
2928
{
30-
if constexpr(std::same_as<T, std::remove_cvref_t<ForwardT>>) return cpp_forward(t);
29+
if constexpr(std::same_as<std::remove_cvref_t<T>, std::remove_cvref_t<ForwardT>>)
30+
return cpp_forward(t);
3131
else return cpp_forward(t).get();
3232
}
3333

@@ -60,10 +60,10 @@ namespace stdsharp::details
6060
template<
6161
typename Self,
6262
typename Seq = args_t::index_sequence,
63-
auto ForwardCast = forward_cast<Self, binder, Impl>>
64-
constexpr auto operator()(this Self&& self, auto&&... args)
65-
noexcept(noexcept(ForwardCast(self).invoke(Seq{}, cpp_forward(args)...))) //
66-
-> decltype(ForwardCast(self).invoke(Seq{}, cpp_forward(args)...))
63+
auto ForwardCast = forward_cast<Self, Impl>>
64+
constexpr decltype(auto) operator()(this Self&& self, auto&&... args)
65+
noexcept(noexcept(ForwardCast(self).invoke(Seq{}, cpp_forward(args)...)))
66+
requires requires { ForwardCast(self).invoke(Seq{}, cpp_forward(args)...); }
6767
{
6868
return ForwardCast(self).invoke(Seq{}, cpp_forward(args)...);
6969
}

include/stdsharp/functional/functional.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#pragma once
2+
23
#include "pipeable.h"
34
#include "stdsharp/functional/always_return.h"
45
#include "stdsharp/functional/bind_front.h"

0 commit comments

Comments
 (0)