-
Notifications
You must be signed in to change notification settings - Fork 79
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Miscellaneous C++20 fixups and nits + import latest BCHN HexStr() impl
- Added header src/bitcoin/concepts.h - Redid some of the templates to better constrain them using concepts - Imported latest BCHN HexStr() impl. which is slightly faster than what we had before.
- Loading branch information
Showing
6 changed files
with
142 additions
and
51 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
// | ||
// Fulcrum - A fast & nimble SPV Server for Bitcoin Cash | ||
// Copyright (C) 2019-2024 Calin A. Culianu <[email protected]> | ||
// | ||
// This program is free software: you can redistribute it and/or modify | ||
// it under the terms of the GNU General Public License as published by | ||
// the Free Software Foundation, either version 3 of the License, or | ||
// (at your option) any later version. | ||
// | ||
// This program is distributed in the hope that it will be useful, | ||
// but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
// GNU General Public License for more details. | ||
// | ||
// You should have received a copy of the GNU General Public License | ||
// along with this program (see LICENSE.txt). If not, see | ||
// <https://www.gnu.org/licenses/>. | ||
// | ||
#pragma once | ||
|
||
#include <cstddef> // for std::byte | ||
#include <cstdint> | ||
#include <type_traits> | ||
|
||
namespace bitcoin { | ||
|
||
// Added by Calin to make some of the bitcoin code more generic | ||
template <typename T> | ||
concept ByteLike = std::is_same_v<T, char> || std::is_same_v<T, uint8_t> | ||
|| std::is_same_v<T, std::byte> || std::is_same_v<T, int8_t> | ||
|| std::is_same_v<T, signed char> || std::is_same_v<T, unsigned char>; | ||
|
||
} // namespace bitcoin |
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
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