Skip to content

Commit

Permalink
New
Browse files Browse the repository at this point in the history
  • Loading branch information
d-frey committed Oct 24, 2024
1 parent 3df45a4 commit 720ec13
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions src/test/compare.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
// Copyright (c) 2024 Daniel Frey and Dr. Colin Hirsch
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at https://www.boost.org/LICENSE_1_0.txt)

#ifndef SRC_TEST_COMPARE_HPP // NOLINT(llvm-header-guard)
#define SRC_TEST_COMPARE_HPP

// This is an internal header used for unit-tests.

#include <cstddef>

namespace tao::pq::internal
{
template< typename T, typename U >
[[nodiscard]] bool compare( const T& lhs, const U& rhs ) noexcept
{
if( lhs.size() != rhs.size() ) {
return false;
}
for( std::size_t i = 0; i != lhs.size(); ++i ) {
if( lhs[ i ] != rhs[ i ] ) {
return false;
}
}
return true;
}

} // namespace tao::pq::internal

#endif

0 comments on commit 720ec13

Please sign in to comment.