Question: I'm compiling the following program using Microsoft Visual C++, as a C++20 program:

```
#include <iostream>
#include <tuple>

int main()
{
    auto t1 = std::make_tuple("one", "two", "three");
    auto t2 = std::make_tuple("one", "two", "three");

    std::cout << "(t1 == t2) is " << std::boolalpha << (t1 == t2) << "\n";
    std::cout << "(t1 != t2) is " << std::boolalpha << (t1 != t2) << "\n";

    return 0;
}

```

When I run it, I see the following output:

```
(t1 == t2) is false
(t1 != t2) is true

```

The tuples are identical, so why does it have wrong comparison results? How do I fix this?

Answer: 
You are comparing pointers to buffers of characters, not strings.

Sometimes the compiler will turn two different `"one"`s into the same buffer, sometimes it will not.

In your case, it isn't. Probably a debug build.

Add `#include <string_view>`, then

```
using namespace std::literals;

auto t1 = std::make_tuple("one"sv, "two"sv, "three"sv);
auto t2 = std::make_tuple("one"sv, "two"sv, "three"sv);

```

and you'll get what you expect. (In pre-[c++17](/questions/tagged/c%2b%2b17 "show questions tagged 'c++17'") compilers, use `<string>` and `""s` instead of `<string_view>` and `""sv`).
The problem is unrelated to C++20, but comes from how string literals are implemented. The answer is for example here:

[Why do (only) some compilers use the same address for identical string literals?](https://stackoverflow.com/questions/52814457/why-do-only-some-compilers-use-the-same-address-for-identical-string-literals)

In short, your program falls into the category of "~~undefined~~ unspecified behavior", as it assumes that identical C-style string literals have identical addresses. This is because expressions like `"a" == "a"` compare addresses, not the content. Your code could be made safe and predictable if you used `std::string` literals, like `"one"s`, `"one"sv` etc., see <https://en.cppreference.com/w/cpp/string/basic_string/operator%22%22s>