-
Notifications
You must be signed in to change notification settings - Fork 1
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
3 changed files
with
57 additions
and
0 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
//// | ||
Copyright 2025 Matt Borland | ||
Distributed under the Boost Software License, Version 1.0. | ||
https://www.boost.org/LICENSE_1_0.txt | ||
//// | ||
|
||
[#Concepts] | ||
= Concepts | ||
:idprefix: concepts_ | ||
|
||
The following are the defintions of the concepts used throughout the library to ensure consistency. | ||
|
||
[#file_system_path] | ||
== File System Path | ||
|
||
Used for the one-shot hashing of files. | ||
Allows a diverse range of ways to specify the file path. | ||
This concept is disabled on CUDA because there is no `std::ifstream` on that platform. | ||
|
||
[source, c++] | ||
---- | ||
namespace boost::crypt::concepts { | ||
#ifndef BOOST_CRYPT_HAS_CUDA | ||
template <typename T> | ||
concept file_system_path = std::is_convertible_v<T, std::string> || | ||
std::is_convertible_v<T, std::string_view> || | ||
std::is_same_v<std::remove_cvref<T>, std::filesystem::path>; | ||
#endif | ||
} // namespace boost::crypt::concepts | ||
---- | ||
|
||
[#writable_output_range] | ||
== Writeable Output Range | ||
|
||
This concept is used to define the ranges that we can write to such as the `get_digest(Range&& data)` function of the hashers. | ||
|
||
[source, c++] | ||
---- | ||
namespace boost::crypt::concepts { | ||
template <typename Range> | ||
concept writable_output_range = compat::output_range<Range, compat::range_value_t<Range>> && | ||
compat::sized_range<Range> && | ||
compat::is_trivially_copyable_v<compat::range_value_t<Range>>; | ||
} // namespace boost::crypt::concepts | ||
---- |