{"id":13424496,"url":"https://github.com/taocpp/operators","last_synced_at":"2025-07-18T16:37:48.503Z","repository":{"id":7628085,"uuid":"8987557","full_name":"taocpp/operators","owner":"taocpp","description":"A highly efficient, move-aware operators library","archived":false,"fork":false,"pushed_at":"2022-12-09T14:01:04.000Z","size":177,"stargazers_count":202,"open_issues_count":0,"forks_count":14,"subscribers_count":20,"default_branch":"main","last_synced_at":"2025-05-13T16:19:59.758Z","etag":null,"topics":["cpp","cpp11","header-only"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/taocpp.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-03-24T14:42:59.000Z","updated_at":"2025-03-16T08:20:42.000Z","dependencies_parsed_at":"2023-01-11T17:12:47.668Z","dependency_job_id":null,"html_url":"https://github.com/taocpp/operators","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"purl":"pkg:github/taocpp/operators","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/taocpp%2Foperators","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/taocpp%2Foperators/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/taocpp%2Foperators/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/taocpp%2Foperators/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/taocpp","download_url":"https://codeload.github.com/taocpp/operators/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/taocpp%2Foperators/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265793684,"owners_count":23829180,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cpp","cpp11","header-only"],"created_at":"2024-07-31T00:00:55.193Z","updated_at":"2025-07-18T16:37:48.477Z","avatar_url":"https://github.com/taocpp.png","language":"C++","readme":"# The Art of C++ / Operators\n\n[![Release](https://img.shields.io/github/release/taocpp/operators.svg)](https://github.com/taocpp/operators/releases/latest)\n[![Download](https://api.bintray.com/packages/conan/conan-center/taocpp-operatorss%3A_/images/download.svg)](https://bintray.com/conan/conan-center/taocpp-operators%3A_/_latestVersion)\n[![TravisCI](https://travis-ci.org/taocpp/operators.svg?branch=main)](https://travis-ci.org/taocpp/operators)\n[![AppVeyor](https://ci.appveyor.com/api/projects/status/794d875ucgic4sq0/branch/main?svg=true)](https://ci.appveyor.com/project/taocpp/operators)\n[![Coverage](https://coveralls.io/repos/github/taocpp/operators/badge.svg?branch=main)](https://coveralls.io/github/taocpp/operators)\n[![Language grade: C/C++](https://img.shields.io/lgtm/grade/cpp/g/taocpp/operators.svg)](https://lgtm.com/projects/g/taocpp/operators/context:cpp)\n\n[The Art of C++](https://taocpp.github.io/) / Operators is a zero-dependency C++11 single-header library that provides highly efficient, move aware operators for arithmetic data types.\n\n### Table of Content\n\n[Overview](#overview)\u003cbr/\u003e\n[Example](#example)\u003cbr/\u003e\n[Requirements](#requirements)\u003cbr/\u003e\n[Installation](#installation)\u003cbr/\u003e\n[Provided Templates](#provided-templates)\u003cbr/\u003e\n[Commutativity](#commutativity)\u003cbr/\u003e\n[RValue References](#rvalue-references)\u003cbr/\u003e\n[constexpr](#constexpr)\u003cbr/\u003e\n[noexcept](#noexcept)\u003cbr/\u003e\n[nodiscard](#nodiscard)\u003cbr/\u003e\n[Changelog](#changelog)\u003cbr/\u003e\n[History](#history)\u003cbr/\u003e\n[License](#license)\n\n## Overview\n\nOverloaded operators for class types typically don't come alone.\nFor example, when `x + y` is possible then `x += y` should be, too.\nWhen `x \u003c y` is possible then `x \u003e y`, `x \u003e= y`, and `x \u003c= y` should be, too.\n\nImplementing large sets of operators, possibly for multiple classes, is both tedious and error-prone.\nHowever, more often than not, some of these operators can be defined in terms of others.\nFor example `x \u003e= y` can frequently be defined as `!(x \u003c y)`.\n\nGiven the implementation of some basic operators, the templates in the Art of C++ / Operators can generate many more operators automatically.\n\nThe generated operators are overloaded to take advantage of movable types, and allow the compiler to avoid unneccessary temporary objects wherever possible.\nAll generated operators are `noexcept` when the underlying operations are `noexcept`.\nGenerated comparison operators are `constexpr` (when supported by the compiler).\n\n## Example\n\nGiven this dummy integer class...\n\n```c++\n#include \u003ctao/operators.hpp\u003e\n\nclass MyInt\n  : tao::operators::commutative_addable\u003c MyInt \u003e,\n    tao::operators::multipliable\u003c MyInt, double \u003e\n{\npublic:\n  // create a new instance of MyInt\n  MyInt( const int v ) noexcept;\n\n  // copy and move constructor\n  MyInt( const MyInt\u0026 v ) noexcept;\n  MyInt( MyInt\u0026\u0026 v ) noexcept; // optional\n\n  // copy and move assignment\n  MyInt\u0026 operator=( const MyInt\u0026 v ) noexcept;\n  MyInt\u0026 operator=( MyInt\u0026\u0026 v ) noexcept; // optional\n\n  // addition of another MyInt\n  MyInt\u0026 operator+=( const MyInt\u0026 v ) noexcept;\n  MyInt\u0026 operator+=( MyInt\u0026\u0026 v ) noexcept; // optional\n\n  // multiplication by a scalar\n  MyInt\u0026 operator*=( const double v ) noexcept;\n};\n```\n\n...the base class templates will *generate* the following operators.\n\n```c++\n// generated by tao::operators::commutative_addable\u003c MyInt \u003e\nMyInt   operator+( const MyInt\u0026 lhs, const MyInt\u0026 rhs ) noexcept;\nMyInt\u0026\u0026 operator+( const MyInt\u0026 lhs, MyInt\u0026\u0026      rhs ) noexcept;\nMyInt\u0026\u0026 operator+( MyInt\u0026\u0026      lhs, const MyInt\u0026 rhs ) noexcept;\nMyInt\u0026\u0026 operator+( MyInt\u0026\u0026      lhs, MyInt\u0026\u0026      rhs ) noexcept;\n\n// generated by tao::operators::multipliable\u003c MyInt, double \u003e\nMyInt   operator*( const MyInt\u0026 lhs, const double\u0026 rhs ) noexcept;\nMyInt   operator*( const MyInt\u0026 lhs, double\u0026\u0026      rhs ) noexcept;\nMyInt\u0026\u0026 operator*( MyInt\u0026\u0026      lhs, const double\u0026 rhs ) noexcept;\nMyInt\u0026\u0026 operator*( MyInt\u0026\u0026      lhs, double\u0026\u0026      rhs ) noexcept;\n```\n\n\u003eNote: The `// optional` in `class MyInt` above marks methods\n\u003ethat you typically only add when your class benefits from an\n\u003ervalue reference parameter. If there is no benefit for the\n\u003eimplementation, you can just omit these methods. If you leave\n\u003ethem out, The Art of C++ / Operators will simply call the corresponding\n\u003enon-movable version that takes the parameter by const lvalue\n\u003ereference.\n\n## Requirements\n\nRequires C++11 or newer. Tested with:\n\n* GCC 4.7+\n* Clang 3.2+\n* Visual Studio 2015+\n\nRemember to enable C++11, e.g., provide `-std=c++11` or similar options.\n\n\u003eNote: If you use or test the library with other compilers/versions,\n\u003ee.g., Visual C++, Intel C++, or any other compiler we'd like to hear from you.\n\n\u003eNote: For compilers that don't support `noexcept`, see chapter [noexcept](#noexcept).\n\n## Installation\n\nThe Art of C++ / Operators is a single-header library. There is nothing to build or install,\njust copy the header somewhere and include it in your code.\n\n## Package Managers\n\nYou can download and install taocpp-operators using the [Conan](https://github.com/conan-io/conan) package manager:\n\n    conan install taocpp-operators/1.2.2@\n\nThe taocpp-operators package in conan is kept up to date by Conan team members and community contributors.\nIf the version is out-of-date, please [create an issue or pull request](https://github.com/conan-io/conan-center-index) on the Conan Center Index repository.\n\n## Provided Templates\n\nThe following table gives an overview of the available templates.\nNote that the \"Provides\" and \"Requires\" columns are just a basic overview.\nMultiple overloads per provided operator might exist to ensure the most\nefficient implementation for each case, exploiting move-semantics when\npossible and (unless explicitly disabled) pass-through of temporary\nvalues to avoid creating new temporaries.\n\nEach overload of an operator is marked `noexcept` when the required operation(s)\nthat are used to implement it are also marked `noexcept`.\n\n\u003ctable\u003e\n\n  \u003ctr\u003e\n    \u003cth\u003eTemplate\u003c/th\u003e\u003cth\u003eProvides\u003c/th\u003e\u003cth\u003eRequires\u003c/th\u003e\n  \u003c/tr\u003e\n\n  \u003c!-- equality_comparable --\u003e\n  \u003ctr valign=\"top\"\u003e\n    \u003ctd\u003e\n      \u003ccode\u003eequality_comparable\u0026lt;\u0026nbsp;T\u0026nbsp;\u0026gt;\u003c/code\u003e\n    \u003c/td\u003e\u003ctd\u003e\n      \u003ccode\u003eT\u0026nbsp;!=\u0026nbsp;T\u003c/code\u003e\n    \u003c/td\u003e\u003ctd\u003e\n      \u003ccode\u003eT\u0026nbsp;==\u0026nbsp;T\u003c/code\u003e\n    \u003c/td\u003e\n  \u003c/tr\u003e\u003ctr valign=\"top\"\u003e\n    \u003ctd\u003e\n      \u003ccode\u003eequality_comparable\u0026lt;\u0026nbsp;T,\u0026nbsp;U\u0026nbsp;\u0026gt;\u003c/code\u003e\n    \u003c/td\u003e\u003ctd\u003e\n      \u003ccode\u003eT\u0026nbsp;!=\u0026nbsp;U\u003c/code\u003e\u003cbr/\u003e\n      \u003ccode\u003eU\u0026nbsp;==\u0026nbsp;T\u003c/code\u003e\u003cbr/\u003e\n      \u003ccode\u003eU\u0026nbsp;!=\u0026nbsp;T\u003c/code\u003e\n    \u003c/td\u003e\u003ctd\u003e\n      \u003ccode\u003eT\u0026nbsp;==\u0026nbsp;U\u003c/code\u003e\n    \u003c/td\u003e\n  \u003c/tr\u003e\n\n  \u003c!-- less_than_comparable --\u003e\n  \u003ctr valign=\"top\"\u003e\n    \u003ctd\u003e\n      \u003ccode\u003eless_than_comparable\u0026lt;\u0026nbsp;T\u0026nbsp;\u0026gt;\u003c/code\u003e\n    \u003c/td\u003e\u003ctd\u003e\n      \u003ccode\u003eT\u0026nbsp;\u0026gt;\u0026nbsp;T\u003c/code\u003e\u003cbr/\u003e\n      \u003ccode\u003eT\u0026nbsp;\u0026lt;=\u0026nbsp;T\u003c/code\u003e\u003cbr/\u003e\n      \u003ccode\u003eT\u0026nbsp;\u0026gt;=\u0026nbsp;T\u003c/code\u003e\n    \u003c/td\u003e\u003ctd\u003e\n      \u003ccode\u003eT\u0026nbsp;\u0026lt;\u0026nbsp;T\u003c/code\u003e\n    \u003c/td\u003e\n  \u003c/tr\u003e\u003ctr valign=\"top\"\u003e\n    \u003ctd\u003e\n      \u003ccode\u003eless_than_comparable\u0026lt;\u0026nbsp;T,\u0026nbsp;U\u0026nbsp;\u0026gt;\u003c/code\u003e\n    \u003c/td\u003e\u003ctd\u003e\n      \u003ccode\u003eT\u0026nbsp;\u0026lt;=\u0026nbsp;U\u003c/code\u003e\u003cbr/\u003e\n      \u003ccode\u003eT\u0026nbsp;\u0026gt;=\u0026nbsp;U\u003c/code\u003e\u003cbr/\u003e\n      \u003ccode\u003eU\u0026nbsp;\u0026lt;\u0026nbsp;T\u003c/code\u003e\u003cbr/\u003e\n      \u003ccode\u003eU\u0026nbsp;\u0026gt;\u0026nbsp;T\u003c/code\u003e\u003cbr/\u003e\n      \u003ccode\u003eU\u0026nbsp;\u0026lt;=\u0026nbsp;T\u003c/code\u003e\u003cbr/\u003e\n      \u003ccode\u003eU\u0026nbsp;\u0026gt;=\u0026nbsp;T\u003c/code\u003e\n    \u003c/td\u003e\u003ctd\u003e\n      \u003ccode\u003eT\u0026nbsp;\u0026lt;\u0026nbsp;U\u003c/code\u003e\u003cbr/\u003e\n      \u003ccode\u003eT\u0026nbsp;\u0026gt;\u0026nbsp;U\u003c/code\u003e\n    \u003c/td\u003e\n  \u003c/tr\u003e\n\n  \u003c!-- equivalent --\u003e\n  \u003ctr valign=\"top\"\u003e\n    \u003ctd\u003e\n      \u003ccode\u003eequivalent\u0026lt;\u0026nbsp;T\u0026nbsp;\u0026gt;\u003c/code\u003e\n    \u003c/td\u003e\u003ctd\u003e\n      \u003ccode\u003eT\u0026nbsp;==\u0026nbsp;T\u003c/code\u003e\n    \u003c/td\u003e\u003ctd\u003e\n      \u003ccode\u003eT\u0026nbsp;\u0026lt;\u0026nbsp;T\u003c/code\u003e\n    \u003c/td\u003e\n  \u003c/tr\u003e\u003ctr valign=\"top\"\u003e\n    \u003ctd\u003e\n      \u003ccode\u003eequivalent\u0026lt;\u0026nbsp;T,\u0026nbsp;U\u0026nbsp;\u0026gt;\u003c/code\u003e\n    \u003c/td\u003e\u003ctd\u003e\n      \u003ccode\u003eT\u0026nbsp;==\u0026nbsp;U\u003c/code\u003e\n    \u003c/td\u003e\u003ctd\u003e\n      \u003ccode\u003eT\u0026nbsp;\u0026lt;\u0026nbsp;U\u003c/code\u003e\u003cbr/\u003e\n      \u003ccode\u003eT\u0026nbsp;\u0026gt;\u0026nbsp;U\u003c/code\u003e\n    \u003c/td\u003e\n  \u003c/tr\u003e\n\n  \u003c!-- partially_ordered --\u003e\n  \u003ctr valign=\"top\"\u003e\n    \u003ctd\u003e\n      \u003ccode\u003epartially_ordered\u0026lt;\u0026nbsp;T\u0026nbsp;\u0026gt;\u003c/code\u003e\n    \u003c/td\u003e\u003ctd\u003e\n      \u003ccode\u003eT\u0026nbsp;\u0026gt;\u0026nbsp;T\u003c/code\u003e\u003cbr/\u003e\n      \u003ccode\u003eT\u0026nbsp;\u0026lt;=\u0026nbsp;T\u003c/code\u003e\u003cbr/\u003e\n      \u003ccode\u003eT\u0026nbsp;\u0026gt;=\u0026nbsp;T\u003c/code\u003e\n    \u003c/td\u003e\u003ctd\u003e\n      \u003ccode\u003eT\u0026nbsp;\u0026lt;\u0026nbsp;T\u003c/code\u003e\u003cbr/\u003e\n      \u003ccode\u003eT\u0026nbsp;==\u0026nbsp;T\u003c/code\u003e\n    \u003c/td\u003e\n  \u003c/tr\u003e\u003ctr valign=\"top\"\u003e\n    \u003ctd\u003e\n      \u003ccode\u003epartially_ordered\u0026lt;\u0026nbsp;T,\u0026nbsp;U\u0026nbsp;\u0026gt;\u003c/code\u003e\n    \u003c/td\u003e\u003ctd\u003e\n      \u003ccode\u003eT\u0026nbsp;\u0026lt;=\u0026nbsp;U\u003c/code\u003e\u003cbr/\u003e\n      \u003ccode\u003eT\u0026nbsp;\u0026gt;=\u0026nbsp;U\u003c/code\u003e\u003cbr/\u003e\n      \u003ccode\u003eU\u0026nbsp;\u0026lt;\u0026nbsp;T\u003c/code\u003e\u003cbr/\u003e\n      \u003ccode\u003eU\u0026nbsp;\u0026gt;\u0026nbsp;T\u003c/code\u003e\u003cbr/\u003e\n      \u003ccode\u003eU\u0026nbsp;\u0026lt;=\u0026nbsp;T\u003c/code\u003e\u003cbr/\u003e\n      \u003ccode\u003eU\u0026nbsp;\u0026gt;=\u0026nbsp;T\u003c/code\u003e\n    \u003c/td\u003e\u003ctd\u003e\n      \u003ccode\u003eT\u0026nbsp;\u0026lt;\u0026nbsp;U\u003c/code\u003e\u003cbr/\u003e\n      \u003ccode\u003eT\u0026nbsp;\u0026gt;\u0026nbsp;U\u003c/code\u003e\u003cbr/\u003e\n      \u003ccode\u003eT\u0026nbsp;==\u0026nbsp;U\u003c/code\u003e\n    \u003c/td\u003e\n  \u003c/tr\u003e\n\n  \u003c!-- addable --\u003e\n  \u003ctr valign=\"top\"\u003e\n    \u003ctd\u003e\n      \u003ccode\u003ecommutative_addable\u0026lt;\u0026nbsp;T\u0026nbsp;\u0026gt;\u003c/code\u003e\n    \u003c/td\u003e\u003ctd\u003e\n      \u003ccode\u003eT\u0026nbsp;+\u0026nbsp;T\u003c/code\u003e\n    \u003c/td\u003e\u003ctd\u003e\n      \u003ccode\u003eT\u0026nbsp;+=\u0026nbsp;T\u003c/code\u003e\n    \u003c/td\u003e\n  \u003c/tr\u003e\u003ctr valign=\"top\"\u003e\n    \u003ctd\u003e\n      \u003ccode\u003ecommutative_addable\u0026lt;\u0026nbsp;T,\u0026nbsp;U\u0026nbsp;\u0026gt;\u003c/code\u003e\n    \u003c/td\u003e\u003ctd\u003e\n      \u003ccode\u003eT\u0026nbsp;+\u0026nbsp;U\u003c/code\u003e\u003cbr/\u003e\n      \u003ccode\u003eU\u0026nbsp;+\u0026nbsp;T\u003c/code\u003e\n    \u003c/td\u003e\u003ctd\u003e\n      \u003ccode\u003eT\u0026nbsp;+=\u0026nbsp;U\u003c/code\u003e\n    \u003c/td\u003e\n  \u003c/tr\u003e\u003ctr valign=\"top\"\u003e\n    \u003ctd\u003e\n      \u003ccode\u003eaddable\u0026lt;\u0026nbsp;T\u0026nbsp;\u0026gt;\u003c/code\u003e\n    \u003c/td\u003e\u003ctd\u003e\n      \u003ccode\u003eT\u0026nbsp;+\u0026nbsp;T\u003c/code\u003e\n    \u003c/td\u003e\u003ctd\u003e\n      \u003ccode\u003eT\u0026nbsp;+=\u0026nbsp;T\u003c/code\u003e\n    \u003c/td\u003e\n  \u003c/tr\u003e\u003ctr valign=\"top\"\u003e\n    \u003ctd\u003e\n      \u003ccode\u003eaddable\u0026lt;\u0026nbsp;T,\u0026nbsp;U\u0026nbsp;\u0026gt;\u003c/code\u003e\n    \u003c/td\u003e\u003ctd\u003e\n      \u003ccode\u003eT\u0026nbsp;+\u0026nbsp;U\u003c/code\u003e\n    \u003c/td\u003e\u003ctd\u003e\n      \u003ccode\u003eT\u0026nbsp;+=\u0026nbsp;U\u003c/code\u003e\n    \u003c/td\u003e\n  \u003c/tr\u003e\u003ctr valign=\"top\"\u003e\n    \u003ctd\u003e\n      \u003ccode\u003eaddable_left\u0026lt;\u0026nbsp;T,\u0026nbsp;U\u0026nbsp;\u0026gt;\u003c/code\u003e\n    \u003c/td\u003e\u003ctd\u003e\n      \u003ccode\u003eU\u0026nbsp;+\u0026nbsp;T\u003c/code\u003e\n    \u003c/td\u003e\u003ctd\u003e\n      \u003ccode\u003eT(\u0026nbsp;U\u0026nbsp;)\u003c/code\u003e\u003cbr/\u003e\n      \u003ccode\u003eT\u0026nbsp;+=\u0026nbsp;T\u003c/code\u003e\n    \u003c/td\u003e\n  \u003c/tr\u003e\n\n  \u003c!-- subtractable --\u003e\n  \u003ctr valign=\"top\"\u003e\n    \u003ctd\u003e\n      \u003ccode\u003esubtractable\u0026lt;\u0026nbsp;T\u0026nbsp;\u0026gt;\u003c/code\u003e\n    \u003c/td\u003e\u003ctd\u003e\n      \u003ccode\u003eT\u0026nbsp;-\u0026nbsp;T\u003c/code\u003e\n    \u003c/td\u003e\u003ctd\u003e\n      \u003ccode\u003eT\u0026nbsp;-=\u0026nbsp;T\u003c/code\u003e\n    \u003c/td\u003e\n  \u003c/tr\u003e\u003ctr valign=\"top\"\u003e\n    \u003ctd\u003e\n      \u003ccode\u003esubtractable\u0026lt;\u0026nbsp;T,\u0026nbsp;U\u0026nbsp;\u0026gt;\u003c/code\u003e\n    \u003c/td\u003e\u003ctd\u003e\n      \u003ccode\u003eT\u0026nbsp;-\u0026nbsp;U\u003c/code\u003e\n    \u003c/td\u003e\u003ctd\u003e\n      \u003ccode\u003eT\u0026nbsp;-=\u0026nbsp;U\u003c/code\u003e\n    \u003c/td\u003e\n  \u003c/tr\u003e\u003ctr valign=\"top\"\u003e\n    \u003ctd\u003e\n      \u003ccode\u003esubtractable_left\u0026lt;\u0026nbsp;T,\u0026nbsp;U\u0026nbsp;\u0026gt;\u003c/code\u003e\n    \u003c/td\u003e\u003ctd\u003e\n      \u003ccode\u003eU\u0026nbsp;-\u0026nbsp;T\u003c/code\u003e\n    \u003c/td\u003e\u003ctd\u003e\n      \u003ccode\u003eT(\u0026nbsp;U\u0026nbsp;)\u003c/code\u003e\u003cbr/\u003e\n      \u003ccode\u003eT\u0026nbsp;-=\u0026nbsp;T\u003c/code\u003e\n    \u003c/td\u003e\n  \u003c/tr\u003e\n\n  \u003c!-- multipliable --\u003e\n  \u003ctr valign=\"top\"\u003e\n    \u003ctd\u003e\n      \u003ccode\u003ecommutative_multipliable\u0026lt;\u0026nbsp;T\u0026nbsp;\u0026gt;\u003c/code\u003e\n    \u003c/td\u003e\u003ctd\u003e\n      \u003ccode\u003eT\u0026nbsp;*\u0026nbsp;T\u003c/code\u003e\n    \u003c/td\u003e\u003ctd\u003e\n      \u003ccode\u003eT\u0026nbsp;*=\u0026nbsp;T\u003c/code\u003e\n    \u003c/td\u003e\n  \u003c/tr\u003e\u003ctr valign=\"top\"\u003e\n    \u003ctd\u003e\n      \u003ccode\u003ecommutative_multipliable\u0026lt;\u0026nbsp;T,\u0026nbsp;U\u0026nbsp;\u0026gt;\u003c/code\u003e\n    \u003c/td\u003e\u003ctd\u003e\n      \u003ccode\u003eT\u0026nbsp;*\u0026nbsp;U\u003c/code\u003e\u003cbr/\u003e\n      \u003ccode\u003eU\u0026nbsp;*\u0026nbsp;T\u003c/code\u003e\n    \u003c/td\u003e\u003ctd\u003e\n      \u003ccode\u003eT\u0026nbsp;*=\u0026nbsp;U\u003c/code\u003e\n    \u003c/td\u003e\n  \u003c/tr\u003e\u003ctr valign=\"top\"\u003e\n    \u003ctd\u003e\n      \u003ccode\u003emultipliable\u0026lt;\u0026nbsp;T\u0026nbsp;\u0026gt;\u003c/code\u003e\n    \u003c/td\u003e\u003ctd\u003e\n      \u003ccode\u003eT\u0026nbsp;*\u0026nbsp;T\u003c/code\u003e\n    \u003c/td\u003e\u003ctd\u003e\n      \u003ccode\u003eT\u0026nbsp;*=\u0026nbsp;T\u003c/code\u003e\n    \u003c/td\u003e\n  \u003c/tr\u003e\u003ctr valign=\"top\"\u003e\n    \u003ctd\u003e\n      \u003ccode\u003emultipliable\u0026lt;\u0026nbsp;T,\u0026nbsp;U\u0026nbsp;\u0026gt;\u003c/code\u003e\n    \u003c/td\u003e\u003ctd\u003e\n      \u003ccode\u003eT\u0026nbsp;*\u0026nbsp;U\u003c/code\u003e\n    \u003c/td\u003e\u003ctd\u003e\n      \u003ccode\u003eT\u0026nbsp;*=\u0026nbsp;U\u003c/code\u003e\n    \u003c/td\u003e\n  \u003c/tr\u003e\u003ctr valign=\"top\"\u003e\n    \u003ctd\u003e\n      \u003ccode\u003emultipliable_left\u0026lt;\u0026nbsp;T,\u0026nbsp;U\u0026nbsp;\u0026gt;\u003c/code\u003e\n    \u003c/td\u003e\u003ctd\u003e\n      \u003ccode\u003eU\u0026nbsp;*\u0026nbsp;T\u003c/code\u003e\n    \u003c/td\u003e\u003ctd\u003e\n      \u003ccode\u003eT(\u0026nbsp;U\u0026nbsp;)\u003c/code\u003e\u003cbr/\u003e\n      \u003ccode\u003eT\u0026nbsp;*=\u0026nbsp;T\u003c/code\u003e\n    \u003c/td\u003e\n  \u003c/tr\u003e\n\n  \u003c!-- dividable --\u003e\n  \u003ctr valign=\"top\"\u003e\n    \u003ctd\u003e\n      \u003ccode\u003edividable\u0026lt;\u0026nbsp;T\u0026nbsp;\u0026gt;\u003c/code\u003e\n    \u003c/td\u003e\u003ctd\u003e\n      \u003ccode\u003eT\u0026nbsp;/\u0026nbsp;T\u003c/code\u003e\n    \u003c/td\u003e\u003ctd\u003e\n      \u003ccode\u003eT\u0026nbsp;/=\u0026nbsp;T\u003c/code\u003e\n    \u003c/td\u003e\n  \u003c/tr\u003e\u003ctr valign=\"top\"\u003e\n    \u003ctd\u003e\n      \u003ccode\u003edividable\u0026lt;\u0026nbsp;T,\u0026nbsp;U\u0026nbsp;\u0026gt;\u003c/code\u003e\n    \u003c/td\u003e\u003ctd\u003e\n      \u003ccode\u003eT\u0026nbsp;/\u0026nbsp;U\u003c/code\u003e\n    \u003c/td\u003e\u003ctd\u003e\n      \u003ccode\u003eT\u0026nbsp;/=\u0026nbsp;U\u003c/code\u003e\n    \u003c/td\u003e\n  \u003c/tr\u003e\u003ctr valign=\"top\"\u003e\n    \u003ctd\u003e\n      \u003ccode\u003edividable_left\u0026lt;\u0026nbsp;T,\u0026nbsp;U\u0026nbsp;\u0026gt;\u003c/code\u003e\n    \u003c/td\u003e\u003ctd\u003e\n      \u003ccode\u003eU\u0026nbsp;/\u0026nbsp;T\u003c/code\u003e\n    \u003c/td\u003e\u003ctd\u003e\n      \u003ccode\u003eT(\u0026nbsp;U\u0026nbsp;)\u003c/code\u003e\u003cbr/\u003e\n      \u003ccode\u003eT\u0026nbsp;/=\u0026nbsp;T\u003c/code\u003e\n    \u003c/td\u003e\n  \u003c/tr\u003e\n\n  \u003c!-- modable --\u003e\n  \u003ctr valign=\"top\"\u003e\n    \u003ctd\u003e\n      \u003ccode\u003emodable\u0026lt;\u0026nbsp;T\u0026nbsp;\u0026gt;\u003c/code\u003e\n    \u003c/td\u003e\u003ctd\u003e\n      \u003ccode\u003eT\u0026nbsp;%\u0026nbsp;T\u003c/code\u003e\n    \u003c/td\u003e\u003ctd\u003e\n      \u003ccode\u003eT\u0026nbsp;%=\u0026nbsp;T\u003c/code\u003e\n    \u003c/td\u003e\n  \u003c/tr\u003e\u003ctr valign=\"top\"\u003e\n    \u003ctd\u003e\n      \u003ccode\u003emodable\u0026lt;\u0026nbsp;T,\u0026nbsp;U\u0026nbsp;\u0026gt;\u003c/code\u003e\n    \u003c/td\u003e\u003ctd\u003e\n      \u003ccode\u003eT\u0026nbsp;%\u0026nbsp;U\u003c/code\u003e\n    \u003c/td\u003e\u003ctd\u003e\n      \u003ccode\u003eT\u0026nbsp;%=\u0026nbsp;U\u003c/code\u003e\n    \u003c/td\u003e\n  \u003c/tr\u003e\u003ctr valign=\"top\"\u003e\n    \u003ctd\u003e\n      \u003ccode\u003emodable_left\u0026lt;\u0026nbsp;T,\u0026nbsp;U\u0026nbsp;\u0026gt;\u003c/code\u003e\n    \u003c/td\u003e\u003ctd\u003e\n      \u003ccode\u003eU\u0026nbsp;%\u0026nbsp;T\u003c/code\u003e\n    \u003c/td\u003e\u003ctd\u003e\n      \u003ccode\u003eT(\u0026nbsp;U\u0026nbsp;)\u003c/code\u003e\u003cbr/\u003e\n      \u003ccode\u003eT\u0026nbsp;%=\u0026nbsp;T\u003c/code\u003e\n    \u003c/td\u003e\n  \u003c/tr\u003e\n\n  \u003c!-- andable --\u003e\n  \u003ctr valign=\"top\"\u003e\n    \u003ctd\u003e\n      \u003ccode\u003ecommutative_andable\u0026lt;\u0026nbsp;T\u0026nbsp;\u0026gt;\u003c/code\u003e\n    \u003c/td\u003e\u003ctd\u003e\n      \u003ccode\u003eT\u0026nbsp;\u0026amp;\u0026nbsp;T\u003c/code\u003e\n    \u003c/td\u003e\u003ctd\u003e\n      \u003ccode\u003eT\u0026nbsp;\u0026amp;=\u0026nbsp;T\u003c/code\u003e\n    \u003c/td\u003e\n  \u003c/tr\u003e\u003ctr valign=\"top\"\u003e\n    \u003ctd\u003e\n      \u003ccode\u003ecommutative_andable\u0026lt;\u0026nbsp;T,\u0026nbsp;U\u0026nbsp;\u0026gt;\u003c/code\u003e\n    \u003c/td\u003e\u003ctd\u003e\n      \u003ccode\u003eT\u0026nbsp;\u0026amp;\u0026nbsp;U\u003c/code\u003e\u003cbr/\u003e\n      \u003ccode\u003eU\u0026nbsp;\u0026amp;\u0026nbsp;T\u003c/code\u003e\n    \u003c/td\u003e\u003ctd\u003e\n      \u003ccode\u003eT\u0026nbsp;\u0026amp;=\u0026nbsp;U\u003c/code\u003e\n    \u003c/td\u003e\n  \u003c/tr\u003e\u003ctr valign=\"top\"\u003e\n    \u003ctd\u003e\n      \u003ccode\u003eandable\u0026lt;\u0026nbsp;T\u0026nbsp;\u0026gt;\u003c/code\u003e\n    \u003c/td\u003e\u003ctd\u003e\n      \u003ccode\u003eT\u0026nbsp;\u0026amp;\u0026nbsp;T\u003c/code\u003e\n    \u003c/td\u003e\u003ctd\u003e\n      \u003ccode\u003eT\u0026nbsp;\u0026amp;=\u0026nbsp;T\u003c/code\u003e\n    \u003c/td\u003e\n  \u003c/tr\u003e\u003ctr valign=\"top\"\u003e\n    \u003ctd\u003e\n      \u003ccode\u003eandable\u0026lt;\u0026nbsp;T,\u0026nbsp;U\u0026nbsp;\u0026gt;\u003c/code\u003e\n    \u003c/td\u003e\u003ctd\u003e\n      \u003ccode\u003eT\u0026nbsp;\u0026amp;\u0026nbsp;U\u003c/code\u003e\n    \u003c/td\u003e\u003ctd\u003e\n      \u003ccode\u003eT\u0026nbsp;\u0026amp;=\u0026nbsp;U\u003c/code\u003e\n    \u003c/td\u003e\n  \u003c/tr\u003e\u003ctr valign=\"top\"\u003e\n    \u003ctd\u003e\n      \u003ccode\u003eandable_left\u0026lt;\u0026nbsp;T,\u0026nbsp;U\u0026nbsp;\u0026gt;\u003c/code\u003e\n    \u003c/td\u003e\u003ctd\u003e\n      \u003ccode\u003eU\u0026nbsp;\u0026amp;\u0026nbsp;T\u003c/code\u003e\n    \u003c/td\u003e\u003ctd\u003e\n      \u003ccode\u003eT(\u0026nbsp;U\u0026nbsp;)\u003c/code\u003e\u003cbr/\u003e\n      \u003ccode\u003eT\u0026nbsp;\u0026amp;=\u0026nbsp;T\u003c/code\u003e\n    \u003c/td\u003e\n  \u003c/tr\u003e\n\n  \u003c!-- orable --\u003e\n  \u003ctr valign=\"top\"\u003e\n    \u003ctd\u003e\n      \u003ccode\u003ecommutative_orable\u0026lt;\u0026nbsp;T\u0026nbsp;\u0026gt;\u003c/code\u003e\n    \u003c/td\u003e\u003ctd\u003e\n      \u003ccode\u003eT\u0026nbsp;|\u0026nbsp;T\u003c/code\u003e\n    \u003c/td\u003e\u003ctd\u003e\n      \u003ccode\u003eT\u0026nbsp;|=\u0026nbsp;T\u003c/code\u003e\n    \u003c/td\u003e\n  \u003c/tr\u003e\u003ctr valign=\"top\"\u003e\n    \u003ctd\u003e\n      \u003ccode\u003ecommutative_orable\u0026lt;\u0026nbsp;T,\u0026nbsp;U\u0026nbsp;\u0026gt;\u003c/code\u003e\n    \u003c/td\u003e\u003ctd\u003e\n      \u003ccode\u003eT\u0026nbsp;|\u0026nbsp;U\u003c/code\u003e\u003cbr/\u003e\n      \u003ccode\u003eU\u0026nbsp;|\u0026nbsp;T\u003c/code\u003e\n    \u003c/td\u003e\u003ctd\u003e\n      \u003ccode\u003eT\u0026nbsp;|=\u0026nbsp;U\u003c/code\u003e\n    \u003c/td\u003e\n  \u003c/tr\u003e\u003ctr valign=\"top\"\u003e\n    \u003ctd\u003e\n      \u003ccode\u003eorable\u0026lt;\u0026nbsp;T\u0026nbsp;\u0026gt;\u003c/code\u003e\n    \u003c/td\u003e\u003ctd\u003e\n      \u003ccode\u003eT\u0026nbsp;|\u0026nbsp;T\u003c/code\u003e\n    \u003c/td\u003e\u003ctd\u003e\n      \u003ccode\u003eT\u0026nbsp;|=\u0026nbsp;T\u003c/code\u003e\n    \u003c/td\u003e\n  \u003c/tr\u003e\u003ctr valign=\"top\"\u003e\n    \u003ctd\u003e\n      \u003ccode\u003eorable\u0026lt;\u0026nbsp;T,\u0026nbsp;U\u0026nbsp;\u0026gt;\u003c/code\u003e\n    \u003c/td\u003e\u003ctd\u003e\n      \u003ccode\u003eT\u0026nbsp;|\u0026nbsp;U\u003c/code\u003e\n    \u003c/td\u003e\u003ctd\u003e\n      \u003ccode\u003eT\u0026nbsp;|=\u0026nbsp;U\u003c/code\u003e\n    \u003c/td\u003e\n  \u003c/tr\u003e\u003ctr valign=\"top\"\u003e\n    \u003ctd\u003e\n      \u003ccode\u003eorable_left\u0026lt;\u0026nbsp;T,\u0026nbsp;U\u0026nbsp;\u0026gt;\u003c/code\u003e\n    \u003c/td\u003e\u003ctd\u003e\n      \u003ccode\u003eU\u0026nbsp;|\u0026nbsp;T\u003c/code\u003e\n    \u003c/td\u003e\u003ctd\u003e\n      \u003ccode\u003eT(\u0026nbsp;U\u0026nbsp;)\u003c/code\u003e\u003cbr/\u003e\n      \u003ccode\u003eT\u0026nbsp;|=\u0026nbsp;T\u003c/code\u003e\n    \u003c/td\u003e\n  \u003c/tr\u003e\n\n  \u003c!-- xorable --\u003e\n  \u003ctr valign=\"top\"\u003e\n    \u003ctd\u003e\n      \u003ccode\u003ecommutative_xorable\u0026lt;\u0026nbsp;T\u0026nbsp;\u0026gt;\u003c/code\u003e\n    \u003c/td\u003e\u003ctd\u003e\n      \u003ccode\u003eT\u0026nbsp;^\u0026nbsp;T\u003c/code\u003e\n    \u003c/td\u003e\u003ctd\u003e\n      \u003ccode\u003eT\u0026nbsp;^=\u0026nbsp;T\u003c/code\u003e\n    \u003c/td\u003e\n  \u003c/tr\u003e\u003ctr valign=\"top\"\u003e\n    \u003ctd\u003e\n      \u003ccode\u003ecommutative_xorable\u0026lt;\u0026nbsp;T,\u0026nbsp;U\u0026nbsp;\u0026gt;\u003c/code\u003e\n    \u003c/td\u003e\u003ctd\u003e\n      \u003ccode\u003eT\u0026nbsp;^\u0026nbsp;U\u003c/code\u003e\u003cbr/\u003e\n      \u003ccode\u003eU\u0026nbsp;^\u0026nbsp;T\u003c/code\u003e\n    \u003c/td\u003e\u003ctd\u003e\n      \u003ccode\u003eT\u0026nbsp;^=\u0026nbsp;U\u003c/code\u003e\n    \u003c/td\u003e\n  \u003c/tr\u003e\u003ctr valign=\"top\"\u003e\n    \u003ctd\u003e\n      \u003ccode\u003exorable\u0026lt;\u0026nbsp;T\u0026nbsp;\u0026gt;\u003c/code\u003e\n    \u003c/td\u003e\u003ctd\u003e\n      \u003ccode\u003eT\u0026nbsp;^\u0026nbsp;T\u003c/code\u003e\n    \u003c/td\u003e\u003ctd\u003e\n      \u003ccode\u003eT\u0026nbsp;^=\u0026nbsp;T\u003c/code\u003e\n    \u003c/td\u003e\n  \u003c/tr\u003e\u003ctr valign=\"top\"\u003e\n    \u003ctd\u003e\n      \u003ccode\u003exorable\u0026lt;\u0026nbsp;T,\u0026nbsp;U\u0026nbsp;\u0026gt;\u003c/code\u003e\n    \u003c/td\u003e\u003ctd\u003e\n      \u003ccode\u003eT\u0026nbsp;^\u0026nbsp;U\u003c/code\u003e\n    \u003c/td\u003e\u003ctd\u003e\n      \u003ccode\u003eT\u0026nbsp;^=\u0026nbsp;U\u003c/code\u003e\n    \u003c/td\u003e\n  \u003c/tr\u003e\u003ctr valign=\"top\"\u003e\n    \u003ctd\u003e\n      \u003ccode\u003exorable_left\u0026lt;\u0026nbsp;T,\u0026nbsp;U\u0026nbsp;\u0026gt;\u003c/code\u003e\n    \u003c/td\u003e\u003ctd\u003e\n      \u003ccode\u003eU\u0026nbsp;^\u0026nbsp;T\u003c/code\u003e\n    \u003c/td\u003e\u003ctd\u003e\n      \u003ccode\u003eT(\u0026nbsp;U\u0026nbsp;)\u003c/code\u003e\u003cbr/\u003e\n      \u003ccode\u003eT\u0026nbsp;^=\u0026nbsp;T\u003c/code\u003e\n    \u003c/td\u003e\n  \u003c/tr\u003e\n\n  \u003c!-- left_shiftable --\u003e\n  \u003ctr valign=\"top\"\u003e\n    \u003ctd\u003e\n      \u003ccode\u003eleft_shiftable\u0026lt;\u0026nbsp;T\u0026nbsp;\u0026gt;\u003c/code\u003e\n    \u003c/td\u003e\u003ctd\u003e\n      \u003ccode\u003eT\u0026nbsp;\u0026lt;\u0026lt;\u0026nbsp;T\u003c/code\u003e\n    \u003c/td\u003e\u003ctd\u003e\n      \u003ccode\u003eT\u0026nbsp;\u0026lt;\u0026lt;=\u0026nbsp;T\u003c/code\u003e\n    \u003c/td\u003e\n  \u003c/tr\u003e\u003ctr valign=\"top\"\u003e\n    \u003ctd\u003e\n      \u003ccode\u003eleft_shiftable\u0026lt;\u0026nbsp;T,\u0026nbsp;U\u0026nbsp;\u0026gt;\u003c/code\u003e\n    \u003c/td\u003e\u003ctd\u003e\n      \u003ccode\u003eT\u0026nbsp;\u0026lt;\u0026lt;\u0026nbsp;U\u003c/code\u003e\n    \u003c/td\u003e\u003ctd\u003e\n      \u003ccode\u003eT\u0026nbsp;\u0026lt;\u0026lt;=\u0026nbsp;U\u003c/code\u003e\n    \u003c/td\u003e\n  \u003c/tr\u003e\n\n  \u003c!-- right_shiftable --\u003e\n  \u003ctr valign=\"top\"\u003e\n    \u003ctd\u003e\n      \u003ccode\u003eright_shiftable\u0026lt;\u0026nbsp;T\u0026nbsp;\u0026gt;\u003c/code\u003e\n    \u003c/td\u003e\u003ctd\u003e\n      \u003ccode\u003eT\u0026nbsp;\u0026gt;\u0026gt;\u0026nbsp;T\u003c/code\u003e\n    \u003c/td\u003e\u003ctd\u003e\n      \u003ccode\u003eT\u0026nbsp;\u0026gt;\u0026gt;=\u0026nbsp;T\u003c/code\u003e\n    \u003c/td\u003e\n  \u003c/tr\u003e\u003ctr valign=\"top\"\u003e\n    \u003ctd\u003e\n      \u003ccode\u003eright_shiftable\u0026lt;\u0026nbsp;T,\u0026nbsp;U\u0026nbsp;\u0026gt;\u003c/code\u003e\n    \u003c/td\u003e\u003ctd\u003e\n      \u003ccode\u003eT\u0026nbsp;\u0026gt;\u0026gt;\u0026nbsp;U\u003c/code\u003e\n    \u003c/td\u003e\u003ctd\u003e\n      \u003ccode\u003eT\u0026nbsp;\u0026gt;\u0026gt;=\u0026nbsp;U\u003c/code\u003e\n    \u003c/td\u003e\n  \u003c/tr\u003e\n\n  \u003c!-- incrementable --\u003e\n  \u003ctr valign=\"top\"\u003e\n    \u003ctd\u003e\n      \u003ccode\u003eincrementable\u0026lt;\u0026nbsp;T\u0026nbsp;\u0026gt;\u003c/code\u003e\n    \u003c/td\u003e\u003ctd\u003e\n      \u003ccode\u003eT++\u003c/code\u003e\n    \u003c/td\u003e\u003ctd\u003e\n      \u003ccode\u003e++T\u003c/code\u003e\n    \u003c/td\u003e\n  \u003c/tr\u003e\n\n  \u003c!-- decrementable --\u003e\n  \u003ctr valign=\"top\"\u003e\n    \u003ctd\u003e\n      \u003ccode\u003edecrementable\u0026lt;\u0026nbsp;T\u0026nbsp;\u0026gt;\u003c/code\u003e\n    \u003c/td\u003e\u003ctd\u003e\n      \u003ccode\u003eT--\u003c/code\u003e\n    \u003c/td\u003e\u003ctd\u003e\n      \u003ccode\u003e--T\u003c/code\u003e\n    \u003c/td\u003e\n  \u003c/tr\u003e\n\n\u003c/table\u003e\n\nThe following templates provide common groups of related operations.\nFor example, since a type which is left shiftable is usually also\nright shiftable, the `shiftable` template provides the combined operators\nof both.\n\n\u003ctable\u003e\n\n  \u003ctr\u003e\n    \u003cth\u003eTemplate\u003c/th\u003e\u003cth\u003eProvides\u003c/th\u003e\n  \u003c/tr\u003e\n\n  \u003c!-- totally_ordered --\u003e\n  \u003ctr valign=\"top\"\u003e\n    \u003ctd\u003e\n      \u003ccode\u003etotally_ordered\u0026lt;\u0026nbsp;T\u0026nbsp;\u0026gt;\u003c/code\u003e\n    \u003c/td\u003e\u003ctd\u003e\n      \u003ccode\u003eequality_comparable\u0026lt;\u0026nbsp;T\u0026nbsp;\u0026gt;\u003c/code\u003e\u003cbr/\u003e\n      \u003ccode\u003eless_than_comparable\u0026lt;\u0026nbsp;T\u0026nbsp;\u0026gt;\u003c/code\u003e\n    \u003c/td\u003e\n  \u003c/tr\u003e\u003ctr valign=\"top\"\u003e\n    \u003ctd\u003e\n      \u003ccode\u003etotally_ordered\u0026lt;\u0026nbsp;T,\u0026nbsp;U\u0026nbsp;\u0026gt;\u003c/code\u003e\n    \u003c/td\u003e\u003ctd\u003e\n      \u003ccode\u003eequality_comparable\u0026lt;\u0026nbsp;T,\u0026nbsp;U\u0026nbsp;\u0026gt;\u003c/code\u003e\u003cbr/\u003e\n      \u003ccode\u003eless_than_comparable\u0026lt;\u0026nbsp;T,\u0026nbsp;U\u0026nbsp;\u0026gt;\u003c/code\u003e\n    \u003c/td\u003e\n  \u003c/tr\u003e\n\n  \u003c!-- ring --\u003e\n  \u003ctr valign=\"top\"\u003e\n    \u003ctd\u003e\n      \u003ccode\u003ecommutative_ring\u0026lt;\u0026nbsp;T\u0026nbsp;\u0026gt;\u003c/code\u003e\n    \u003c/td\u003e\u003ctd\u003e\n      \u003ccode\u003ecommutative_addable\u0026lt;\u0026nbsp;T\u0026nbsp;\u0026gt;\u003c/code\u003e\u003cbr/\u003e\n      \u003ccode\u003esubtractable\u0026lt;\u0026nbsp;T\u0026nbsp;\u0026gt;\u003c/code\u003e\u003cbr/\u003e\n      \u003ccode\u003ecommutative_multipliable\u0026lt;\u0026nbsp;T\u0026nbsp;\u0026gt;\u003c/code\u003e\n    \u003c/td\u003e\n  \u003c/tr\u003e\u003ctr valign=\"top\"\u003e\n    \u003ctd\u003e\n      \u003ccode\u003ecommutative_ring\u0026lt;\u0026nbsp;T,\u0026nbsp;U\u0026nbsp;\u0026gt;\u003c/code\u003e\n    \u003c/td\u003e\u003ctd\u003e\n      \u003ccode\u003ecommutative_addable\u0026lt;\u0026nbsp;T,\u0026nbsp;U\u0026nbsp;\u0026gt;\u003c/code\u003e\u003cbr/\u003e\n      \u003ccode\u003esubtractable\u0026lt;\u0026nbsp;T,\u0026nbsp;U\u0026nbsp;\u0026gt;\u003c/code\u003e\u003cbr/\u003e\n      \u003ccode\u003esubtractable_left\u0026lt;\u0026nbsp;T,\u0026nbsp;U\u0026nbsp;\u0026gt;\u003c/code\u003e\u003cbr/\u003e\n      \u003ccode\u003ecommutative_multipliable\u0026lt;\u0026nbsp;T,\u0026nbsp;U\u0026nbsp;\u0026gt;\u003c/code\u003e\n    \u003c/td\u003e\n  \u003c/tr\u003e\u003ctr valign=\"top\"\u003e\n    \u003ctd\u003e\n      \u003ccode\u003ering\u0026lt;\u0026nbsp;T\u0026nbsp;\u0026gt;\u003c/code\u003e\n    \u003c/td\u003e\u003ctd\u003e\n      \u003ccode\u003ecommutative_addable\u0026lt;\u0026nbsp;T\u0026nbsp;\u0026gt;\u003c/code\u003e\u003cbr/\u003e\n      \u003ccode\u003esubtractable\u0026lt;\u0026nbsp;T\u0026nbsp;\u0026gt;\u003c/code\u003e\u003cbr/\u003e\n      \u003ccode\u003emultipliable\u0026lt;\u0026nbsp;T\u0026nbsp;\u0026gt;\u003c/code\u003e\n    \u003c/td\u003e\n  \u003c/tr\u003e\u003ctr valign=\"top\"\u003e\n    \u003ctd\u003e\n      \u003ccode\u003ering\u0026lt;\u0026nbsp;T,\u0026nbsp;U\u0026nbsp;\u0026gt;\u003c/code\u003e\n    \u003c/td\u003e\u003ctd\u003e\n      \u003ccode\u003ecommutative_addable\u0026lt;\u0026nbsp;T,\u0026nbsp;U\u0026nbsp;\u0026gt;\u003c/code\u003e\u003cbr/\u003e\n      \u003ccode\u003esubtractable\u0026lt;\u0026nbsp;T,\u0026nbsp;U\u0026nbsp;\u0026gt;\u003c/code\u003e\u003cbr/\u003e\n      \u003ccode\u003esubtractable_left\u0026lt;\u0026nbsp;T,\u0026nbsp;U\u0026nbsp;\u0026gt;\u003c/code\u003e\u003cbr/\u003e\n      \u003ccode\u003emultipliable\u0026lt;\u0026nbsp;T,\u0026nbsp;U\u0026nbsp;\u0026gt;\u003c/code\u003e\n    \u003c/td\u003e\n  \u003c/tr\u003e\n\n  \u003c!-- field --\u003e\n  \u003ctr valign=\"top\"\u003e\n    \u003ctd\u003e\n      \u003ccode\u003efield\u0026lt;\u0026nbsp;T\u0026nbsp;\u0026gt;\u003c/code\u003e\n    \u003c/td\u003e\u003ctd\u003e\n      \u003ccode\u003ecommutative_ring\u0026lt;\u0026nbsp;T\u0026nbsp;\u0026gt;\u003c/code\u003e\u003cbr/\u003e\n      \u003ccode\u003edividable\u0026lt;\u0026nbsp;T\u0026nbsp;\u0026gt;\u003c/code\u003e\n    \u003c/td\u003e\n  \u003c/tr\u003e\u003ctr valign=\"top\"\u003e\n    \u003ctd\u003e\n      \u003ccode\u003efield\u0026lt;\u0026nbsp;T,\u0026nbsp;U\u0026nbsp;\u0026gt;\u003c/code\u003e\n    \u003c/td\u003e\u003ctd\u003e\n      \u003ccode\u003ecommutative_ring\u0026lt;\u0026nbsp;T,\u0026nbsp;U\u0026nbsp;\u0026gt;\u003c/code\u003e\u003cbr/\u003e\n      \u003ccode\u003edividable\u0026lt;\u0026nbsp;T,\u0026nbsp;U\u0026nbsp;\u0026gt;\u003c/code\u003e\u003cbr/\u003e\n      \u003ccode\u003edividable_left\u0026lt;\u0026nbsp;T,\u0026nbsp;U\u0026nbsp;\u0026gt;\u003c/code\u003e\n    \u003c/td\u003e\n  \u003c/tr\u003e\n\n  \u003c!-- ordered_commutative_ring --\u003e\n  \u003ctr valign=\"top\"\u003e\n    \u003ctd\u003e\n      \u003ccode\u003eordered_commutative_ring\u0026lt;\u0026nbsp;T\u0026nbsp;\u0026gt;\u003c/code\u003e\n    \u003c/td\u003e\u003ctd\u003e\n      \u003ccode\u003ecommutative_ring\u0026lt;\u0026nbsp;T\u0026nbsp;\u0026gt;\u003c/code\u003e\u003cbr/\u003e\n      \u003ccode\u003etotally_ordered\u0026lt;\u0026nbsp;T\u0026nbsp;\u0026gt;\u003c/code\u003e\n    \u003c/td\u003e\n  \u003c/tr\u003e\u003ctr valign=\"top\"\u003e\n    \u003ctd\u003e\n      \u003ccode\u003eordered_commutative_ring\u0026lt;\u0026nbsp;T,\u0026nbsp;U\u0026nbsp;\u0026gt;\u003c/code\u003e\n    \u003c/td\u003e\u003ctd\u003e\n      \u003ccode\u003ecommutative_ring\u0026lt;\u0026nbsp;T,\u0026nbsp;U\u0026nbsp;\u0026gt;\u003c/code\u003e\u003cbr/\u003e\n      \u003ccode\u003etotally_ordered\u0026lt;\u0026nbsp;T,\u0026nbsp;U\u0026nbsp;\u0026gt;\u003c/code\u003e\n    \u003c/td\u003e\n  \u003c/tr\u003e\n\n  \u003c!-- ordered_ring --\u003e\n  \u003ctr valign=\"top\"\u003e\n    \u003ctd\u003e\n      \u003ccode\u003eordered_ring\u0026lt;\u0026nbsp;T\u0026nbsp;\u0026gt;\u003c/code\u003e\n    \u003c/td\u003e\u003ctd\u003e\n      \u003ccode\u003ering\u0026lt;\u0026nbsp;T\u0026nbsp;\u0026gt;\u003c/code\u003e\u003cbr/\u003e\n      \u003ccode\u003etotally_ordered\u0026lt;\u0026nbsp;T\u0026nbsp;\u0026gt;\u003c/code\u003e\n    \u003c/td\u003e\n  \u003c/tr\u003e\u003ctr valign=\"top\"\u003e\n    \u003ctd\u003e\n      \u003ccode\u003eordered_ring\u0026lt;\u0026nbsp;T,\u0026nbsp;U\u0026nbsp;\u0026gt;\u003c/code\u003e\n    \u003c/td\u003e\u003ctd\u003e\n      \u003ccode\u003ering\u0026lt;\u0026nbsp;T,\u0026nbsp;U\u0026nbsp;\u0026gt;\u003c/code\u003e\u003cbr/\u003e\n      \u003ccode\u003etotally_ordered\u0026lt;\u0026nbsp;T,\u0026nbsp;U\u0026nbsp;\u0026gt;\u003c/code\u003e\n    \u003c/td\u003e\n  \u003c/tr\u003e\n\n  \u003c!-- ordered_field --\u003e\n  \u003ctr valign=\"top\"\u003e\n    \u003ctd\u003e\n      \u003ccode\u003eordered_field\u0026lt;\u0026nbsp;T\u0026nbsp;\u0026gt;\u003c/code\u003e\n    \u003c/td\u003e\u003ctd\u003e\n      \u003ccode\u003efield\u0026lt;\u0026nbsp;T\u0026nbsp;\u0026gt;\u003c/code\u003e\u003cbr/\u003e\n      \u003ccode\u003etotally_ordered\u0026lt;\u0026nbsp;T\u0026nbsp;\u0026gt;\u003c/code\u003e\n    \u003c/td\u003e\n  \u003c/tr\u003e\u003ctr valign=\"top\"\u003e\n    \u003ctd\u003e\n      \u003ccode\u003eordered_field\u0026lt;\u0026nbsp;T,\u0026nbsp;U\u0026nbsp;\u0026gt;\u003c/code\u003e\n    \u003c/td\u003e\u003ctd\u003e\n      \u003ccode\u003efield\u0026lt;\u0026nbsp;T,\u0026nbsp;U\u0026nbsp;\u0026gt;\u003c/code\u003e\u003cbr/\u003e\n      \u003ccode\u003etotally_ordered\u0026lt;\u0026nbsp;T,\u0026nbsp;U\u0026nbsp;\u0026gt;\u003c/code\u003e\n    \u003c/td\u003e\n  \u003c/tr\u003e\n\n  \u003c!-- bitwise --\u003e\n  \u003ctr valign=\"top\"\u003e\n    \u003ctd\u003e\n      \u003ccode\u003ecommutative_bitwise\u0026lt;\u0026nbsp;T\u0026nbsp;\u0026gt;\u003c/code\u003e\n    \u003c/td\u003e\u003ctd\u003e\n      \u003ccode\u003ecommutative_andable\u0026lt;\u0026nbsp;T\u0026nbsp;\u0026gt;\u003c/code\u003e\u003cbr/\u003e\n      \u003ccode\u003ecommutative_orable\u0026lt;\u0026nbsp;T\u0026nbsp;\u0026gt;\u003c/code\u003e\u003cbr/\u003e\n      \u003ccode\u003ecommutative_xorable\u0026lt;\u0026nbsp;T\u0026nbsp;\u0026gt;\u003c/code\u003e\n    \u003c/td\u003e\n  \u003c/tr\u003e\u003ctr valign=\"top\"\u003e\n    \u003ctd\u003e\n      \u003ccode\u003ecommutative_bitwise\u0026lt;\u0026nbsp;T,\u0026nbsp;U\u0026nbsp;\u0026gt;\u003c/code\u003e\n    \u003c/td\u003e\u003ctd\u003e\n      \u003ccode\u003ecommutative_andable\u0026lt;\u0026nbsp;T,\u0026nbsp;U\u0026nbsp;\u0026gt;\u003c/code\u003e\u003cbr/\u003e\n      \u003ccode\u003ecommutative_orable\u0026lt;\u0026nbsp;T,\u0026nbsp;U\u0026nbsp;\u0026gt;\u003c/code\u003e\u003cbr/\u003e\n      \u003ccode\u003ecommutative_xorable\u0026lt;\u0026nbsp;T,\u0026nbsp;U\u0026nbsp;\u0026gt;\u003c/code\u003e\n    \u003c/td\u003e\n  \u003c/tr\u003e\u003ctr valign=\"top\"\u003e\n    \u003ctd\u003e\n      \u003ccode\u003ebitwise\u0026lt;\u0026nbsp;T\u0026nbsp;\u0026gt;\u003c/code\u003e\n    \u003c/td\u003e\u003ctd\u003e\n      \u003ccode\u003eandable\u0026lt;\u0026nbsp;T\u0026nbsp;\u0026gt;\u003c/code\u003e\u003cbr/\u003e\n      \u003ccode\u003eorable\u0026lt;\u0026nbsp;T\u0026nbsp;\u0026gt;\u003c/code\u003e\u003cbr/\u003e\n      \u003ccode\u003exorable\u0026lt;\u0026nbsp;T\u0026nbsp;\u0026gt;\u003c/code\u003e\n    \u003c/td\u003e\n  \u003c/tr\u003e\u003ctr valign=\"top\"\u003e\n    \u003ctd\u003e\n      \u003ccode\u003ebitwise\u0026lt;\u0026nbsp;T,\u0026nbsp;U\u0026nbsp;\u0026gt;\u003c/code\u003e\n    \u003c/td\u003e\u003ctd\u003e\n      \u003ccode\u003eandable\u0026lt;\u0026nbsp;T,\u0026nbsp;U\u0026nbsp;\u0026gt;\u003c/code\u003e\u003cbr/\u003e\n      \u003ccode\u003eorable\u0026lt;\u0026nbsp;T,\u0026nbsp;U\u0026nbsp;\u0026gt;\u003c/code\u003e\u003cbr/\u003e\n      \u003ccode\u003exorable\u0026lt;\u0026nbsp;T,\u0026nbsp;U\u0026nbsp;\u0026gt;\u003c/code\u003e\n    \u003c/td\u003e\n  \u003c/tr\u003e\u003ctr valign=\"top\"\u003e\n    \u003ctd\u003e\n      \u003ccode\u003ebitwise_left\u0026lt;\u0026nbsp;T,\u0026nbsp;U\u0026nbsp;\u0026gt;\u003c/code\u003e\n    \u003c/td\u003e\u003ctd\u003e\n      \u003ccode\u003eandable_left\u0026lt;\u0026nbsp;T,\u0026nbsp;U\u0026nbsp;\u0026gt;\u003c/code\u003e\u003cbr/\u003e\n      \u003ccode\u003eorable_left\u0026lt;\u0026nbsp;T,\u0026nbsp;U\u0026nbsp;\u0026gt;\u003c/code\u003e\u003cbr/\u003e\n      \u003ccode\u003exorable_left\u0026lt;\u0026nbsp;T,\u0026nbsp;U\u0026nbsp;\u0026gt;\u003c/code\u003e\n    \u003c/td\u003e\n  \u003c/tr\u003e\n\n  \u003c!-- shiftable --\u003e\n  \u003ctr valign=\"top\"\u003e\n    \u003ctd\u003e\n      \u003ccode\u003eshiftable\u0026lt;\u0026nbsp;T\u0026nbsp;\u0026gt;\u003c/code\u003e\n    \u003c/td\u003e\u003ctd\u003e\n      \u003ccode\u003eleft_shiftable\u0026lt;\u0026nbsp;T\u0026nbsp;\u0026gt;\u003c/code\u003e\u003cbr/\u003e\n      \u003ccode\u003eright_shiftable\u0026lt;\u0026nbsp;T\u0026nbsp;\u0026gt;\u003c/code\u003e\n    \u003c/td\u003e\n  \u003c/tr\u003e\u003ctr valign=\"top\"\u003e\n    \u003ctd\u003e\n      \u003ccode\u003eshiftable\u0026lt;\u0026nbsp;T,\u0026nbsp;U\u0026nbsp;\u0026gt;\u003c/code\u003e\n    \u003c/td\u003e\u003ctd\u003e\n      \u003ccode\u003eleft_shiftable\u0026lt;\u0026nbsp;T,\u0026nbsp;U\u0026nbsp;\u0026gt;\u003c/code\u003e\u003cbr/\u003e\n      \u003ccode\u003eright_shiftable\u0026lt;\u0026nbsp;T,\u0026nbsp;U\u0026nbsp;\u0026gt;\u003c/code\u003e\n    \u003c/td\u003e\n  \u003c/tr\u003e\n\n  \u003c!-- unit_steppable --\u003e\n  \u003ctr valign=\"top\"\u003e\n    \u003ctd\u003e\n      \u003ccode\u003eunit_steppable\u0026lt;\u0026nbsp;T\u0026nbsp;\u0026gt;\u003c/code\u003e\n    \u003c/td\u003e\u003ctd\u003e\n      \u003ccode\u003eincrementable\u0026lt;\u0026nbsp;T\u0026nbsp;\u0026gt;\u003c/code\u003e\u003cbr/\u003e\n      \u003ccode\u003edecrementable\u0026lt;\u0026nbsp;T\u0026nbsp;\u0026gt;\u003c/code\u003e\n    \u003c/td\u003e\n  \u003c/tr\u003e\n\n\u003c/table\u003e\n\n## Commutativity\n\nFor some templates, there are both [commutative](https://en.wikipedia.org/wiki/Commutative_property)\nand non-commutative versions available. If the class you are writing is\ncommutative wrt an operation, you should prefer the commutative template,\ni.e., the one which has `commutative_` at the beginning.\n\nIt will be *more efficient* in some cases because it can avoid an\nextra temporary for the result and it has *fewer requirements*.\n\nThe one-argument version of the commutative template provides the same\noperators as the non-commutative one, but you can see from the result type\nin which cases creating a temporary (returning `T`) can be avoided\n(returning `T\u0026\u0026`).\n\nFor the two-argument version, `commutative_{OP}\u003c T, U \u003e` provides the operators\nof both `{OP}\u003c T, U \u003e` and `{OP}_left\u003c T, U \u003e`, again the return type indicates\nthose cases where an extra temporary is avoided.\n\n## RValue References\n\nAs you can see above, several overloads of some operators return rvalue references.\nThis helps to eliminate temporaries in more complicated expressions, but some people\nconsider it dangerous. The argument against returning rvalue references usually\nis something like:\n\n```c++\nconst auto\u0026 result = a + b + c;\n```\n\nwhere they expect a temporary to be returned from the expression `a + b + c`,\nand the lifetime of the temporary can be extended by binding it to a reference.\n\nWhile this would work if an actual temporary value is returned, it does not work with\nthe second operator `+` returning an rvalue reference to the *intermediate* temporary\ncreated by the first operator `+`.\n\nI consider the above code bad style that has no place in modern C++. It should be\nreplaced by\n\n```c++\nconst auto result = a + b + c;\n```\n\nand the problem goes away. Also, if you *expect* an expression to return a temporary\nvalue, but you don't *verify* your assumption, it is your fault for basing your code\non those assumptions.\n\nThere is, however, one problem where the above binding to a references happens behind\nthe scenes, i.e. without being immediately visible. It may happen if you are using\na range-based for-loop. The problem in this case is not limited to returning rvalue\nreferences, hence you should always make sure that you do not mix any kind of expression\nother than directly naming a variable when using a range-based for-loop. Example:\n\n```c++\n// instead of this:\nfor( const auto\u0026 e : a + b + c ) { ... }\n\n// always use something like this:\nconst auto r = a + b + c;\nfor( const auto\u0026 e : r ) { ... }\n```\n\nWith all that said, you can disable returning rvalue references by defining\n`TAO_OPERATORS_NO_RVALUE_REFERENCE_RESULTS`. If it is set, all operators will\nreturn a value (an rvalue) instead of rvalue references.\n\n## constexpr\n\nAll generated comparison operators are `constexpr` by default.\nTo switch off `constexpr` support simply\n\n```c++\n#define TAO_OPERATORS_CONSTEXPR\n```\n\nbefore including `\u003ctao/operators.hpp\u003e`.\n\nNote that Visual C++ seems to have some problems with `constexpr` depending\non compile mode (debug/release), etc. and `constexpr` support is therefore\ndisabled by default. To manually enable it again use\n\n```c++\n#define TAO_OPERATORS_CONSTEXPR constexpr\n```\n\nbefore including `\u003ctao/operators.hpp\u003e`.\n\n## noexcept\n\nFor compilers that do not support `noexcept`, the following might be a viable\nwork-around:\n\n```c++\n#include \u003cutility\u003e // make sure it's included before the following!\n#define noexcept(...)\n// you probably also need this for older compilers:\n#define TAO_OPERATORS_CONSTEXPR\n#include \u003ctao/operators.hpp\u003e\n#undef noexcept\n```\n\n## nodiscard\n\nWhen compiling with C++17 or higher, all generated methods are marked `[[nodiscard]]`.\nFor compilers that do not support `[[nodiscard]]` or when it is causing trouble,\nyou can disable it defining `TAO_OPERATORS_NODISCARD`:\n\n```c++\n#define TAO_OPERATORS_NODISCARD\n#include \u003ctao/operators.hpp\u003e\n```\n\n## Changelog\n\n### 1.2.2\n\nReleased 2019-06-04\n\n* Fix `CMakeLists.txt` version number.\n\n### 1.2.1\n\nReleased 2019-06-04\n\n* Add work-around for MSVC to fix broken EBO in more cases.\n\n### 1.2.0\n\nReleased 2019-03-30\n\n* Add support for `[[nodiscard]]`.\n\n### 1.1.1\n\nReleased 2018-06-17\n\n* Automatic upload of Conan packages on release.\n\n### 1.1.0\n\nReleased 2018-06-17\n\n* Add `constexpr` support for comparison operators.\n\n### 1.0.2\n\nReleased 2018-06-05\n\n* Improve CMake support.\n* Conan support.\n\n### 1.0.1\n\nReleased 2018-04-23\n\n* Work-around for MSVC to fix broken EBO.\n\n### 1.0.0\n\nReleased 2018-02-13\n\n* Initial release.\n\n## History\n\nThe Art of C++ / Operators is a modernised C++11 rewrite of the [Boost.Operators](http://www.boost.org/doc/libs/1_66_0/libs/utility/operators.htm) library.\n\n## License\n\nThe Art of C++ is certified [Open Source](http://www.opensource.org/docs/definition.html) software. It may be used for any purpose, including commercial purposes, at absolutely no cost. It is distributed under the terms of the [MIT license](http://www.opensource.org/licenses/mit-license.html) reproduced here.\n\n\u003e Copyright (c) 2013-2020 Daniel Frey\n\u003e\n\u003e Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\u003e\n\u003e The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\u003e\n\u003e THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","funding_links":[],"categories":["Containers and Algorithms"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftaocpp%2Foperators","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftaocpp%2Foperators","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftaocpp%2Foperators/lists"}