Skip to content

Commit

Permalink
fix compiler errors
Browse files Browse the repository at this point in the history
  • Loading branch information
felixjulianheitmann committed Sep 20, 2024
1 parent 8d325ed commit 880bc19
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
1 change: 1 addition & 0 deletions modules/crypto/include/lcxx/hash.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#ifndef LCXX__CRYPTO_HASH_HPP__
#define LCXX__CRYPTO_HASH_HPP__

#include <array>
#include <span>
#include <string>

Expand Down
8 changes: 6 additions & 2 deletions tests/crypto/hash_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,13 @@

#include <lcxx/hash.hpp>

template < std::ranges::range R > auto str_to_vec( std::string_view const str ) -> R
template < std::ranges::range R >
auto str_to_vec( std::string_view const str ) -> R
requires( sizeof( std::ranges::range_value_t< R > ) == 1 )
{
auto bytes = str | std::views::transform( []( auto && c ) { return std::ranges::range_value_t< R >{ c }; } );
auto bytes = str | std::views::transform( []( auto && c ) {
return *reinterpret_cast< std::ranges::range_value_t< R > const * >( &c );
} );
return { bytes.begin(), bytes.end() };
}

Expand Down

0 comments on commit 880bc19

Please sign in to comment.