DryChem 1.0.0
A generic, compile-time C++ toolbox with no dependencies for the modern computational chemistry project.
Loading...
Searching...
No Matches
operatorDetails.hpp
Go to the documentation of this file.
1// Copyright (c) 2020-2025 Cody R. Drisko. All rights reserved.
2// Licensed under the MIT License. See the LICENSE file in the project root for more information.
3//
4// Name: operatorDetails.hpp
5// Author: crdrisko
6// Date: 11/15/2020-11:01:03
7// Description: Details to be used with the testing of the operators portion of the utilities library
8
9#ifndef DRYCHEM_COMMON_UTILITIES_LIBS_UTILITIES_TESTS_DETAILS_OPERATORDETAILS_HPP
10#define DRYCHEM_COMMON_UTILITIES_LIBS_UTILITIES_TESTS_DETAILS_OPERATORDETAILS_HPP
11
13
15{
17 class EmptyDerived : public DryChem::PotentiallyEmptyBaseClass<EmptyDerived>
18 {
19 };
20
21 class SomewhatComparable1 : private DryChem::EqualityComparable<SomewhatComparable1>
22 {
23 private:
24 int value;
25
26 public:
27 explicit SomewhatComparable1(int Value) noexcept : value {Value} {}
28
29 friend bool operator==(const SomewhatComparable1& lhs, const SomewhatComparable1& rhs) noexcept
30 {
31 return lhs.value == rhs.value;
32 }
33 };
34
35 class SomewhatComparable2 : private DryChem::LessThanComparable<SomewhatComparable2>
36 {
37 private:
38 int value;
39
40 public:
41 explicit SomewhatComparable2(int Value) noexcept : value {Value} {}
42
43 friend bool operator<(const SomewhatComparable2& lhs, const SomewhatComparable2& rhs) noexcept
44 {
45 return lhs.value < rhs.value;
46 }
47 };
48
49 class Comparable : private DryChem::CompletelyComparable<Comparable>
50 {
51 private:
52 int value;
53
54 public:
55 explicit Comparable(int Value) noexcept : value {Value} {}
56
57 friend bool operator==(const Comparable& lhs, const Comparable& rhs) noexcept { return lhs.value == rhs.value; }
58 friend bool operator<(const Comparable& lhs, const Comparable& rhs) noexcept { return lhs.value < rhs.value; }
59 };
60} // namespace CppUtils::Operators::details::testing
61
62#endif
friend bool operator==(const Comparable &lhs, const Comparable &rhs) noexcept
Definition operatorDetails.hpp:57
Comparable(int Value) noexcept
Definition operatorDetails.hpp:55
friend bool operator<(const Comparable &lhs, const Comparable &rhs) noexcept
Definition operatorDetails.hpp:58
int value
Definition operatorDetails.hpp:52
The EBCO and CRTP used together for an empty class.
Definition operatorDetails.hpp:18
SomewhatComparable1(int Value) noexcept
Definition operatorDetails.hpp:27
friend bool operator==(const SomewhatComparable1 &lhs, const SomewhatComparable1 &rhs) noexcept
Definition operatorDetails.hpp:29
friend bool operator<(const SomewhatComparable2 &lhs, const SomewhatComparable2 &rhs) noexcept
Definition operatorDetails.hpp:43
SomewhatComparable2(int Value) noexcept
Definition operatorDetails.hpp:41
Definition operatorDetails.hpp:15