[ Web Proxy ]
URL:
Viewing: https://ru.cppreference.com/cpp/concepts/regular [Back]  [Original]

std::regular cppreference.com
cppreference.com

std::regular

cppreference.com
<tbody> </tbody>
template <class T> concept regular = std::semiregular<T> && std::equality_comparable<T>;
( C++20)

regular , , , . , , int, ==.

#include <concepts>
#include <iostream>

template<std::regular T>
struct Single {
    T value;
    friend bool operator==(const Single&, const Single&) = default;
};

int main()
{
    Single<int> myInt1{4};
    Single<int> myInt2;
    myInt2 = myInt1;

    if (myInt1 == myInt2)
        std::cout << "\n";

    std::cout << myInt1.value << ' ' << myInt2.value << '\n';
}

:


4 4

, , ,
() []

Web Proxy Viewer  |  New URL  |  Original Page