-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
89 additions
and
66 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#pragma once | ||
|
||
#include <ranges> | ||
#include <concepts> | ||
|
||
namespace hage { | ||
template<typename R, typename V> | ||
concept RangeOf = std::ranges::range<R> && std::convertible_to<std::ranges::range_reference_t<R>, V>; | ||
|
||
template<typename R, typename V> | ||
concept InputRangeOf = std::ranges::input_range<R> && std::convertible_to<std::ranges::range_reference_t<R>, V>; | ||
|
||
template<typename R, typename V> | ||
concept CommonRangeOf = std::ranges::common_range<R> && std::convertible_to<std::ranges::range_reference_t<R>, V>; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
#pragma once | ||
|
||
#include <cstdio> | ||
#include <string_view> | ||
|
||
namespace hage { | ||
// stolen from jason turner | ||
struct LifetimeTester | ||
{ | ||
explicit LifetimeTester(int) noexcept { std::printf("LifetimeTester::LifetimeTester(int)\n"); } | ||
LifetimeTester() noexcept { std::printf("LifetimeTester::LifetimeTester()\n"); } | ||
LifetimeTester(LifetimeTester&&) noexcept { std::printf("LifetimeTester::LifetimeTester(LifetimeTester&&)\n");} | ||
LifetimeTester(const LifetimeTester&) noexcept { std::printf("LifetimeTester::LifetimeTester(const LifetimeTester&)\n"); } | ||
~LifetimeTester() noexcept { std::printf("LifetimeTester::~LifetimeTester()\n"); } | ||
LifetimeTester& operator=(const LifetimeTester&) noexcept | ||
{ | ||
std::printf("LifetimeTester::operator=(const LifetimeTester&)\n"); | ||
return *this; | ||
} | ||
LifetimeTester& operator=(LifetimeTester&&) noexcept | ||
{ | ||
std::printf("LifetimeTester::operator=(LifetimeTester&&)\n"); | ||
return *this; | ||
} | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
#pragma once | ||
|
||
#include <array> | ||
|
||
namespace hage { | ||
namespace details { | ||
#ifdef __cpp_lib_hardware_interference_size | ||
#include <new> | ||
static constexpr auto constructive_interference_size = std::hardware_constructive_interference_size; | ||
static constexpr auto destructive_interference_size = std::hardware_destructive_interference_size; | ||
#else | ||
// 64 bytes on x86-64 │ L1_CACHE_BYTES │ L1_CACHE_SHIFT │ __cacheline_aligned │ ... | ||
static constexpr std::size_t constructive_interference_size = 64; | ||
static constexpr std::size_t destructive_interference_size = 64; | ||
#endif | ||
|
||
} | ||
|
||
template<typename... T> | ||
[[nodiscard]] constexpr std::array<std::byte, sizeof...(T)> | ||
byte_array(T... a) | ||
{ | ||
return { static_cast<std::byte>(a)... }; | ||
} | ||
|
||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
#pragma once | ||
|
||
#include "../misc.hpp" | ||
#include <hage/core/misc.hpp> | ||
|
||
#include "byte_buffer.hpp" | ||
|
||
#include <span> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,7 @@ | ||
#pragma once | ||
#include "../misc.hpp" | ||
|
||
#include <hage/core/concepts.hpp> | ||
|
||
#include <chrono> | ||
#include <vector> | ||
|
||
|
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters