diff options
| -rw-r--r-- | include/ocl/allocator_op.hpp | 3 | ||||
| -rw-r--r-- | include/ocl/crc_hash.hpp | 12 | ||||
| -rw-r--r-- | include/ocl/io.hpp | 6 | ||||
| -rw-r--r-- | include/ocl/is_same.hpp | 28 | ||||
| -rw-r--r-- | include/ocl/option.hpp | 46 | ||||
| -rw-r--r-- | include/ocl/smart_ptr.hpp | 11 | ||||
| -rw-r--r-- | include/ocl/smart_socket.hpp | 2 | ||||
| -rw-r--r-- | include/ocl/tracked_ptr.hpp | 2 |
8 files changed, 56 insertions, 54 deletions
diff --git a/include/ocl/allocator_op.hpp b/include/ocl/allocator_op.hpp index ed6ae90..dcdbdaa 100644 --- a/include/ocl/allocator_op.hpp +++ b/include/ocl/allocator_op.hpp @@ -64,12 +64,11 @@ namespace ocl return std::shared_ptr<ret_type>(allocator_new{}.template var_alloc<var_type...>(std::forward<var_type...>(args)...), allocator_delete{}); } - template<size_t N> + template <size_t N> auto construct_array() { return std::shared_ptr<ret_type>(allocator_new{}.template array_alloc<N>(), allocator_delete{}); } - }; template <typename type> diff --git a/include/ocl/crc_hash.hpp b/include/ocl/crc_hash.hpp index c782cd3..6fe885a 100644 --- a/include/ocl/crc_hash.hpp +++ b/include/ocl/crc_hash.hpp @@ -60,14 +60,14 @@ namespace ocl 0xbdbdf21c, 0xcabac28a, 0x53b39330, 0x24b4a3a6, 0xbad03605, 0xcdd70693, 0x54de5729, 0x23d967bf, 0xb3667a2e, 0xc4614ab8, 0x5d681b02, 0x2a6f2b94, 0xb40bbe37, 0xc30c8ea1, 0x5a05df1b, 0x2d02ef8d}; - template <typename algorithm> + template <typename algorithm> static constexpr algorithm crc(const char* in, std::size_t len) { if (!len) return 0UL; - algorithm crc = 0xffffffff; - std::size_t cnt = 0; + algorithm crc = 0xffffffff; + std::size_t cnt = 0; while ((len--) > 0) { @@ -78,10 +78,10 @@ namespace ocl return ~crc; } - template <std::uint8_t algorithm> + template <std::uint8_t algorithm> constexpr std::uint8_t crc(const char* in, std::size_t len) = delete; - template <std::uint64_t algorithm> + template <std::uint64_t algorithm> constexpr std::uint64_t crc(const char* in, std::size_t len) = delete; }; @@ -95,7 +95,7 @@ namespace ocl inline void operator""_crc(const char* in, std::size_t len) noexcept { - ocl::crc_hash_trait::crc<std::uint32_t>(reinterpret_cast<const char*>(in), strlen(in)); + ocl::crc_hash_trait::crc<std::uint32_t>(reinterpret_cast<const char*>(in), strlen(in)); } namespace std diff --git a/include/ocl/io.hpp b/include/ocl/io.hpp index 834031b..188f321 100644 --- a/include/ocl/io.hpp +++ b/include/ocl/io.hpp @@ -25,11 +25,11 @@ namespace ocl::io { class void_stream final { - void_stream() = default; + void_stream() = default; ~void_stream() = default; - void_stream& operator<<(...) = delete; - void_stream& operator>>(...) = delete; + void_stream& operator<<(...) = delete; + void_stream& operator>>(...) = delete; } inline void_stream void_cout; diff --git a/include/ocl/is_same.hpp b/include/ocl/is_same.hpp index 519a87b..b8b5ccf 100644 --- a/include/ocl/is_same.hpp +++ b/include/ocl/is_same.hpp @@ -19,7 +19,7 @@ namespace ocl using result_type = typename T::result_type; using type = T; - // AMLALE: If it throws, we can't compute the hash correctly. + // AMLALE: If it throws, we can't compute the hash correctly. static constexpr result_type hash() noexcept { return T{}.hash(); @@ -29,8 +29,8 @@ namespace ocl template <typename T, typename U> struct is_same { - using left_type = T; - using right_type = T; + using left_type = T; + using right_type = T; static constexpr bool value = false; }; @@ -44,8 +44,8 @@ namespace ocl template <typename T, typename U> struct is_not_same { - using left_type = T; - using right_type = T; + using left_type = T; + using right_type = T; static constexpr bool value = true; }; @@ -61,7 +61,7 @@ namespace ocl { using result_type = bool; - static constexpr auto value = sizeof(T) == 1; + static constexpr auto value = sizeof(T) == 1; }; template <typename T> @@ -69,7 +69,7 @@ namespace ocl { using result_type = bool; - static constexpr auto value = sizeof(T) > 1; + static constexpr auto value = sizeof(T) > 1; }; template <typename T> @@ -77,27 +77,27 @@ namespace ocl { using result_type = bool; - static constexpr auto value = sizeof(T) >= 4; + static constexpr auto value = sizeof(T) >= 4; }; template <typename L, typename R> struct equiv_is final { using result_type = bool; - using left_type = L; - using right_type = R; + using left_type = L; + using right_type = R; - static constexpr auto value = false; + static constexpr auto value = false; }; template <typename L> struct equiv_is<L, L> final { using result_type = bool; - using left_type = L; - using right_type = L; + using left_type = L; + using right_type = L; - static constexpr auto value = true; + static constexpr auto value = true; }; } // namespace ocl diff --git a/include/ocl/option.hpp b/include/ocl/option.hpp index 73af0ae..2fa47e9 100644 --- a/include/ocl/option.hpp +++ b/include/ocl/option.hpp @@ -22,12 +22,12 @@ namespace ocl class option final { - public: + public: option() = delete; explicit option(const return_type& return_type) : ret_(return_type) { - assert(ret_ != return_type::invalid); + assert(ret_ != return_type::invalid); } ~option() = default; @@ -37,7 +37,7 @@ namespace ocl option& expect(const char* input) { - assert(ret_ != return_type::invalid); + assert(ret_ != return_type::invalid); if (ret_ == return_type::err) { @@ -50,11 +50,11 @@ namespace ocl template <typename ErrorHandler> option& expect_or_handle(const char* input) { - assert(ret_ != return_type::invalid); + assert(ret_ != return_type::invalid); if (ret_ == return_type::err) { - // AMLALE: Shall it be a functor or container here? + // AMLALE: Shall it be a functor or container here? ErrorHandler{}(input ? input : "option::error"); } @@ -67,24 +67,24 @@ namespace ocl namespace detail { - // AMLALE: They (operator()) were marked `noexcept` as failing conditions within an evaluation (say a overloads operator==) proves that the - // predictate is wrong. + // AMLALE: They (operator()) were marked `noexcept` as failing conditions within an evaluation (say a overloads operator==) proves that the + // predictate is wrong. - struct teller - { - explicit teller() = default; - virtual ~teller() = default; + struct teller + { + explicit teller() = default; + virtual ~teller() = default; - template <class ObjFirst, class ObjLast> + template <class ObjFirst, class ObjLast> bool operator()(ObjFirst a, ObjLast b) noexcept - { - return false; - } - }; - - struct int_eq_teller final : teller + { + return false; + } + }; + + struct int_eq_teller final : teller { - template <class ObjFirst, class ObjLast> + template <class ObjFirst, class ObjLast> bool operator()(ObjFirst a, ObjLast b) noexcept { return (a == b); @@ -93,7 +93,7 @@ namespace ocl struct int_greater_than_teller final : teller { - template <class ObjFirst, class ObjLast> + template <class ObjFirst, class ObjLast> bool operator()(ObjFirst a, ObjLast b) noexcept { return (a > b); @@ -102,8 +102,8 @@ namespace ocl struct int_less_than_teller final : teller { - template <class ObjFirst, class ObjLast> - bool operator()(ObjFirst a, ObjLast b) noexcept + template <class ObjFirst, class ObjLast> + bool operator()(ObjFirst a, ObjLast b) noexcept { return (a < b); } @@ -113,7 +113,7 @@ namespace ocl template <typename Teller, typename... Lst> inline return_type eval(const Teller& tell, Lst&&... arg) { - static_assert(std::is_base_of_v<detail::teller, Teller>, "Teller is not evalueable."); + static_assert(std::is_base_of_v<detail::teller, Teller>, "Teller is not evalueable."); return tell(std::forward<Lst>(arg)...) ? return_type::okay : return_type::err; } diff --git a/include/ocl/smart_ptr.hpp b/include/ocl/smart_ptr.hpp index 23671f1..489f277 100644 --- a/include/ocl/smart_ptr.hpp +++ b/include/ocl/smart_ptr.hpp @@ -21,9 +21,12 @@ namespace ocl template <class T> using shared_ptr = std::shared_ptr<T>; - /// @brief Constructs a `delete_ptr`, that is, a pointer that isn't deleted from the heap. - template<class T> - inline auto delete_ptr(T* object) -> auto { return shared_ptr<T>{ object, boost::null_deleter{}}; } -} + /// @brief Constructs a `delete_ptr`, that is, a pointer that isn't deleted from the heap. + template <class T> + inline auto delete_ptr(T* object) -> auto + { + return shared_ptr<T>{object, boost::null_deleter{}}; + } +} // namespace ocl #endif // ifndef __OCL_SMART_PTR
\ No newline at end of file diff --git a/include/ocl/smart_socket.hpp b/include/ocl/smart_socket.hpp index ea9c73b..331f86d 100644 --- a/include/ocl/smart_socket.hpp +++ b/include/ocl/smart_socket.hpp @@ -14,7 +14,7 @@ #include <boost/asio.hpp> #ifdef OCL_POSIX -# include <ocl/posix/unique_socket.hpp> +#include <ocl/posix/unique_socket.hpp> #endif #endif // !__OCL_FREESTANDING diff --git a/include/ocl/tracked_ptr.hpp b/include/ocl/tracked_ptr.hpp index 03e1644..cda37a8 100644 --- a/include/ocl/tracked_ptr.hpp +++ b/include/ocl/tracked_ptr.hpp @@ -218,7 +218,7 @@ namespace ocl namespace detail { - using tracked_error = std::runtime_error; + using tracked_error = std::runtime_error; inline void throw_tracked_error() { |
