MCPcopy Create free account
hub / github.com/NVIDIA/cuda-quantum / string_equal

Function string_equal

unittests/utils/Matrix.cpp:20–29  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

18#include <algorithm>
19
20void string_equal(std::string str1, std::string str2) {
21 auto is_space = [](char c) {
22 return c == ' ';
23 }; // *only* space, opposed to builtin isspace
24 auto it = std::remove_if(str1.begin(), str1.end(), is_space);
25 str1 = std::string(str1.begin(), it);
26 it = std::remove_if(str2.begin(), str2.end(), is_space);
27 str2 = std::string(str2.begin(), it);
28 EXPECT_EQ(str1, str2);
29}
30
31TEST(Tensor, initialization) {
32 {

Callers 1

TESTFunction · 0.85

Calls 2

beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected