Skip to content

Commit fe95196

Browse files
authored
Update bind.hpp
1 parent 9da74ce commit fe95196

File tree

1 file changed

+48
-48
lines changed

1 file changed

+48
-48
lines changed

bind.hpp

Lines changed: 48 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -7,71 +7,71 @@
77
#include "is_reference_wrapper.hpp"
88
#include "invoke.hpp"
99

10-
template<class TiD,
11-
bool = is_reference_wrapper_v<TiD>,
12-
bool = std::is_bind_expression_v<TiD>,
13-
bool = ((std::is_placeholder_v<TiD>) > 0)>
10+
template<class TDi,
11+
bool = is_reference_wrapper_v<TDi>,
12+
bool = std::is_bind_expression_v<TDi>,
13+
bool = ((std::is_placeholder_v<TDi>) > 0)>
1414
struct BoundArgument;
1515

16-
template<class TiD>
17-
struct BoundArgument<TiD, true, false, false> {
18-
template<class cvTiD, class... Uj>
19-
static constexpr auto value(cvTiD& tid, Uj&&...)
20-
-> typename TiD::type&
16+
template<class TDi>
17+
struct BoundArgument<TDi, true, false, false> {
18+
template<class cvTDi, class... U>
19+
static constexpr auto value(cvTDi& tdi, U&&...)
20+
-> typename TDi::type&
2121
{
22-
static_assert(std::is_same_v<std::remove_cv_t<cvTiD>, TiD>);
23-
return tid.get();
22+
static_assert(std::is_same_v<std::remove_cv_t<cvTDi>, TDi>);
23+
return tdi.get();
2424
}
2525
template<class...>
26-
using type = typename TiD::type&;
26+
using type = typename TDi::type&;
2727
template<class...>
28-
using const_type = typename TiD::type&;
28+
using const_type = typename TDi::type&;
2929
};
3030

31-
template<class TiD>
32-
struct BoundArgument<TiD, false, true, false> {
33-
template<class cvTiD, class... Uj>
34-
static constexpr auto value(cvTiD& tid, Uj&&... uj)
35-
-> std::invoke_result_t<cvTiD&, Uj&&...>
31+
template<class TDi>
32+
struct BoundArgument<TDi, false, true, false> {
33+
template<class cvTDi, class... U>
34+
static constexpr auto value(cvTDi& tdi, U&&... u)
35+
-> std::invoke_result_t<cvTDi&, U&&...>
3636
{
37-
static_assert(std::is_same_v<std::remove_cv_t<cvTiD>, TiD>);
38-
return tid(std::forward<Uj>(uj)...);
37+
static_assert(std::is_same_v<std::remove_cv_t<cvTDi>, TDi>);
38+
return tdi(std::forward<U>(u)...);
3939
}
40-
template<class... Uj>
41-
using type = std::invoke_result_t<TiD&, Uj&&...>;
42-
template<class... Uj>
43-
using const_type = std::invoke_result_t<TiD const&, Uj&&...>;
40+
template<class... U>
41+
using type = std::invoke_result_t<TDi&, U&&...>;
42+
template<class... U>
43+
using const_type = std::invoke_result_t<TDi const&, U&&...>;
4444
};
4545

46-
template<class TiD>
47-
struct BoundArgument<TiD, false, false, true> {
48-
static constexpr int position { std::is_placeholder_v<TiD> - 1 };
49-
template<class cvTiD, class... Uj>
50-
static constexpr auto value(cvTiD& tid, Uj&&... uj)
51-
-> std::tuple_element_t<position,std::tuple<Uj...>>
46+
template<class TDi>
47+
struct BoundArgument<TDi, false, false, true> {
48+
static constexpr int position { std::is_placeholder_v<TDi> - 1 };
49+
template<class cvTDi, class... U>
50+
static constexpr auto value(cvTDi& tdi, U&&... u)
51+
-> std::tuple_element_t<position,std::tuple<U...>>
5252
{
53-
static_assert(std::is_same_v<std::remove_cv_t<cvTiD>, TiD>);
54-
return std::get<position>(std::forward_as_tuple(std::forward<Uj>(uj)...));
53+
static_assert(std::is_same_v<std::remove_cv_t<cvTDi>, TDi>);
54+
return std::get<position>(std::forward_as_tuple(std::forward<U>(u)...));
5555
}
56-
template<class... Uj>
57-
using type = std::tuple_element_t<position,std::tuple<Uj...>>;
58-
template<class... Uj>
59-
using const_type = std::tuple_element_t<position,std::tuple<Uj...>>;
56+
template<class... U>
57+
using type = std::tuple_element_t<position, std::tuple<U...>>;
58+
template<class... U>
59+
using const_type = std::tuple_element_t<position, std::tuple<U...>>;
6060
};
6161

62-
template<class TiD, bool, bool, bool>
62+
template<class TDi, bool, bool, bool>
6363
struct BoundArgument {
64-
template<class cvTiD, class... Uj>
65-
static constexpr auto value(cvTiD& tid, Uj&&...)
66-
-> cvTiD&
64+
template<class cvTDi, class... U>
65+
static constexpr auto value(cvTDi& tdi, U&&...)
66+
-> cvTDi&
6767
{
68-
static_assert(std::is_same_v<std::remove_cv_t<cvTiD>, TiD>);
69-
return tid;
68+
static_assert(std::is_same_v<std::remove_cv_t<cvTDi>, TDi>);
69+
return tdi;
7070
}
7171
template<class...>
72-
using type = TiD&;
72+
using type = TDi&;
7373
template<class...>
74-
using const_type = TiD const&;
74+
using const_type = TDi const&;
7575
};
7676

7777
template<class FD, class R, class... BoundArgs>
@@ -82,7 +82,7 @@ struct Bind {
8282
template<class cvFD, class BoundArgTpl, class... UnBoundArgs, std::size_t... idx,
8383
class T = R, std::enable_if_t<std::is_same_v<T,void(void)>, int> = 0>
8484
static constexpr decltype(auto) unpack_bound_args(cvFD& fd,
85-
/* cv std::tuple<TiD...>& */ BoundArgTpl& bound_args,
85+
/* cv std::tuple<TDi...>& */ BoundArgTpl& bound_args,
8686
std::index_sequence<idx...>,
8787
UnBoundArgs&&... unbound_args
8888
) {
@@ -92,12 +92,12 @@ struct Bind {
9292
template<class cvFD, class BoundArgTpl, class... UnBoundArgs, std::size_t... idx,
9393
class T = R, std::enable_if_t<!std::is_same_v<T,void(void)>, int> = 0>
9494
static constexpr T unpack_bound_args(cvFD& fd,
95-
/* cv std::tuple<TiD...>& */ BoundArgTpl& bound_args,
95+
/* cv std::tuple<TDi...>& */ BoundArgTpl& bound_args,
9696
std::index_sequence<idx...>,
9797
UnBoundArgs&&... unbound_args
9898
) {
99-
return (invoke<T>)(fd,BoundArgument<BoundArgs>::value(std::get<idx>(bound_args),
100-
std::forward<UnBoundArgs>(unbound_args)...)...);
99+
return (invoke<T>)(fd, BoundArgument<BoundArgs>::value(std::get<idx>(bound_args),
100+
std::forward<UnBoundArgs>(unbound_args)...)...);
101101
}
102102
public:
103103
template<class... UnBoundArgs>

0 commit comments

Comments
 (0)