mirror of
https://github.com/darlinghq/darling-libcxx.git
synced 2024-12-13 23:08:46 +00:00
fa1e5db3bc
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@258196 91177308-0d34-0410-b5e6-96231b3b80d8
53 lines
1.6 KiB
C++
53 lines
1.6 KiB
C++
//===----------------------------------------------------------------------===//
|
|
//
|
|
// The LLVM Compiler Infrastructure
|
|
//
|
|
// This file is dual licensed under the MIT and the University of Illinois Open
|
|
// Source Licenses. See LICENSE.TXT for details.
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
#ifndef SUPPORT_USER_DEFINED_INTEGRAL_HPP
|
|
#define SUPPORT_USER_DEFINED_INTEGRAL_HPP
|
|
|
|
template <class T>
|
|
struct UserDefinedIntegral
|
|
{
|
|
UserDefinedIntegral() : value(0) {}
|
|
UserDefinedIntegral(T v) : value(v) {}
|
|
operator T() const { return value; }
|
|
T value;
|
|
};
|
|
|
|
// Poison the arithmetic and comparison operations
|
|
template <class T, class U>
|
|
void operator+(UserDefinedIntegral<T>, UserDefinedIntegral<U>);
|
|
|
|
template <class T, class U>
|
|
void operator-(UserDefinedIntegral<T>, UserDefinedIntegral<U>);
|
|
|
|
template <class T, class U>
|
|
void operator*(UserDefinedIntegral<T>, UserDefinedIntegral<U>);
|
|
|
|
template <class T, class U>
|
|
void operator/(UserDefinedIntegral<T>, UserDefinedIntegral<U>);
|
|
|
|
template <class T, class U>
|
|
void operator==(UserDefinedIntegral<T>, UserDefinedIntegral<U>);
|
|
|
|
template <class T, class U>
|
|
void operator!=(UserDefinedIntegral<T>, UserDefinedIntegral<U>);
|
|
|
|
template <class T, class U>
|
|
void operator<(UserDefinedIntegral<T>, UserDefinedIntegral<U>);
|
|
|
|
template <class T, class U>
|
|
void operator>(UserDefinedIntegral<T>, UserDefinedIntegral<U>);
|
|
|
|
template <class T, class U>
|
|
void operator<=(UserDefinedIntegral<T>, UserDefinedIntegral<U>);
|
|
|
|
template <class T, class U>
|
|
void operator>=(UserDefinedIntegral<T>, UserDefinedIntegral<U>);
|
|
|
|
#endif // SUPPORT_USER_DEFINED_INTEGRAL_HPP
|