GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
std::regular(3) C++ Standard Libary std::regular(3)

std::regular - std::regular


Defined in header <concepts>
template <class T> (since C++20)
concept regular = std::semiregular<T> && std::equality_comparable<T>;


The regular concept specifies that a type is regular, that is, it is copyable,
default constructible, and equality comparable. It is satisfied by types that behave
similarly to built-in types like int, and that are comparable with ==.

// Run this code


#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 << "Equal\n";


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


Equal
4 4


semiregular specifies that an object of a type can be copied, moved, swapped, and
(C++20) default constructed
(concept)

2022.07.31 http://cppreference.com

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.