mirror of
https://github.com/Naios/continuable.git
synced 2025-12-06 16:56:44 +08:00
size_t -> std::size_t
This commit is contained in:
parent
b2780a7abb
commit
655a40cd36
@ -192,7 +192,7 @@ public:
|
|||||||
|
|
||||||
/// Placeholder
|
/// Placeholder
|
||||||
template<typename... _CTy>
|
template<typename... _CTy>
|
||||||
Continuable& some(size_t const count, _CTy&&...)
|
Continuable& some(std::size_t const count, _CTy&&...)
|
||||||
{
|
{
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
@ -340,10 +340,10 @@ namespace detail
|
|||||||
};
|
};
|
||||||
|
|
||||||
/// Position wrapper class to pass ints as type
|
/// Position wrapper class to pass ints as type
|
||||||
template<size_t Position, typename Tuple>
|
template<std::size_t Position, typename Tuple>
|
||||||
struct partial_result
|
struct partial_result
|
||||||
{
|
{
|
||||||
static size_t const position = Position;
|
static std::size_t const position = Position;
|
||||||
|
|
||||||
typedef Tuple tuple;
|
typedef Tuple tuple;
|
||||||
};
|
};
|
||||||
@ -443,20 +443,20 @@ namespace detail
|
|||||||
return remove_void_trait(box_continuable_trait(std::forward<_CTy>(functional)));
|
return remove_void_trait(box_continuable_trait(std::forward<_CTy>(functional)));
|
||||||
}
|
}
|
||||||
|
|
||||||
template<size_t Position, typename Args, typename Pack, typename... Rest>
|
template<std::size_t Position, typename Args, typename Pack, typename... Rest>
|
||||||
struct multiple_result_maker;
|
struct multiple_result_maker;
|
||||||
|
|
||||||
template<size_t Position, typename... Args, typename... Pack>
|
template<std::size_t Position, typename... Args, typename... Pack>
|
||||||
struct multiple_result_maker<Position, fu::identity<Args...>, fu::identity<Pack...>>
|
struct multiple_result_maker<Position, fu::identity<Args...>, fu::identity<Pack...>>
|
||||||
{
|
{
|
||||||
typedef fu::identity<Args...> arguments_t;
|
typedef fu::identity<Args...> arguments_t;
|
||||||
|
|
||||||
typedef fu::identity<Pack...> partial_results_t;
|
typedef fu::identity<Pack...> partial_results_t;
|
||||||
|
|
||||||
static size_t const size = Position;
|
static std::size_t const size = Position;
|
||||||
};
|
};
|
||||||
|
|
||||||
template<size_t Position, typename Args, typename Pack, typename Next, typename... Rest>
|
template<std::size_t Position, typename Args, typename Pack, typename Next, typename... Rest>
|
||||||
struct multiple_result_maker<Position, Args, Pack, Next, Rest...>
|
struct multiple_result_maker<Position, Args, Pack, Next, Rest...>
|
||||||
: public multiple_result_maker<
|
: public multiple_result_maker<
|
||||||
Position + 1,
|
Position + 1,
|
||||||
|
|||||||
@ -29,9 +29,9 @@ class WeakCallbackContainer
|
|||||||
{
|
{
|
||||||
std::shared_ptr<WeakCallbackContainer> self_reference;
|
std::shared_ptr<WeakCallbackContainer> self_reference;
|
||||||
|
|
||||||
typedef size_t handle_t;
|
typedef std::size_t handle_t;
|
||||||
|
|
||||||
size_t handle;
|
std::size_t handle;
|
||||||
|
|
||||||
std::unordered_map<decltype(handle), boost::any> container;
|
std::unordered_map<decltype(handle), boost::any> container;
|
||||||
|
|
||||||
@ -44,7 +44,7 @@ class WeakCallbackContainer
|
|||||||
// Creates a weak proxy callback which prevents invoking to an invalid context.
|
// Creates a weak proxy callback which prevents invoking to an invalid context.
|
||||||
// Removes itself from the owner with the given handler.
|
// Removes itself from the owner with the given handler.
|
||||||
static callback_of_t<_CTy> CreateProxy(std::weak_ptr<WeakCallbackContainer> const& weak_owner,
|
static callback_of_t<_CTy> CreateProxy(std::weak_ptr<WeakCallbackContainer> const& weak_owner,
|
||||||
size_t const handle, weak_callback_of_t<_CTy> const& weak_callback)
|
std::size_t const handle, weak_callback_of_t<_CTy> const& weak_callback)
|
||||||
{
|
{
|
||||||
return [=](Args&&... args)
|
return [=](Args&&... args)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -27,6 +27,7 @@
|
|||||||
#include <functional>
|
#include <functional>
|
||||||
#include <type_traits>
|
#include <type_traits>
|
||||||
#include <utility>
|
#include <utility>
|
||||||
|
#include <cstddef>
|
||||||
|
|
||||||
namespace fu
|
namespace fu
|
||||||
{
|
{
|
||||||
@ -35,25 +36,25 @@ namespace fu
|
|||||||
struct identity { };
|
struct identity { };
|
||||||
|
|
||||||
/// Sequence class which is used to carry parameter packs of unsigned integers.
|
/// Sequence class which is used to carry parameter packs of unsigned integers.
|
||||||
template<size_t...>
|
template<std::size_t...>
|
||||||
struct sequence { };
|
struct sequence { };
|
||||||
|
|
||||||
/// The Sequence generator generates a sequence of numbers with the given size.
|
/// The Sequence generator generates a sequence of ascending numbers with the given size.
|
||||||
template<size_t...>
|
template<std::size_t...>
|
||||||
struct sequence_generator;
|
struct sequence_generator;
|
||||||
|
|
||||||
template<size_t... Stack>
|
template<std::size_t... Stack>
|
||||||
struct sequence_generator<0, Stack...>
|
struct sequence_generator<0, Stack...>
|
||||||
{
|
{
|
||||||
typedef sequence<Stack...> type;
|
typedef sequence<Stack...> type;
|
||||||
};
|
};
|
||||||
|
|
||||||
template<size_t Position, size_t... Stack>
|
template<std::size_t Position, std::size_t... Stack>
|
||||||
struct sequence_generator<Position, Stack...>
|
struct sequence_generator<Position, Stack...>
|
||||||
: public sequence_generator<Position - 1, Position - 1, Stack...> { };
|
: public sequence_generator<Position - 1, Position - 1, Stack...> { };
|
||||||
|
|
||||||
/// Sequence generator alias
|
/// Sequence generator alias
|
||||||
template<size_t Size>
|
template<std::size_t Size>
|
||||||
using sequence_of_t = typename sequence_generator<Size>::type;
|
using sequence_of_t = typename sequence_generator<Size>::type;
|
||||||
|
|
||||||
namespace detail
|
namespace detail
|
||||||
@ -216,7 +217,7 @@ namespace fu
|
|||||||
template<typename Sequence>
|
template<typename Sequence>
|
||||||
struct invoker;
|
struct invoker;
|
||||||
|
|
||||||
template<size_t... Sequence>
|
template<std::size_t... Sequence>
|
||||||
struct invoker<sequence<Sequence...>>
|
struct invoker<sequence<Sequence...>>
|
||||||
{
|
{
|
||||||
template<typename _FTy, typename _TTy>
|
template<typename _FTy, typename _TTy>
|
||||||
|
|||||||
2
test.cpp
2
test.cpp
@ -96,7 +96,7 @@ void test_unwrap(std::string const& msg)
|
|||||||
std::cout << msg << " is unwrappable: " << (fu::is_unwrappable<T...>::value ? "true" : "false") << std::endl;
|
std::cout << msg << " is unwrappable: " << (fu::is_unwrappable<T...>::value ? "true" : "false") << std::endl;
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
template<size_t N>
|
template<std::size_t N>
|
||||||
struct Apply {
|
struct Apply {
|
||||||
template<typename F, typename T, typename... A>
|
template<typename F, typename T, typename... A>
|
||||||
static inline auto apply(F && f, T && t, A &&... a)
|
static inline auto apply(F && f, T && t, A &&... a)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user