brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1013 B · 24f540c Raw
27 lines · c
1//===----------------------------------------------------------------------===//2//3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.4// See https://llvm.org/LICENSE.txt for license information.5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception6//7//===----------------------------------------------------------------------===//8 9#ifndef TEST_SUPPORT_PRIVATE_CONSTRUCTOR_H10#define TEST_SUPPORT_PRIVATE_CONSTRUCTOR_H11 12struct PrivateConstructor {13 14    PrivateConstructor static make ( int v ) { return PrivateConstructor(v); }15    int get () const { return val; }16private:17    PrivateConstructor ( int v ) : val(v) {}18    int val;19    };20 21bool operator < ( const PrivateConstructor &lhs, const PrivateConstructor &rhs ) { return lhs.get() < rhs.get(); }22 23bool operator < ( const PrivateConstructor &lhs, int rhs ) { return lhs.get() < rhs; }24bool operator < ( int lhs, const PrivateConstructor &rhs ) { return lhs < rhs.get(); }25 26#endif // TEST_SUPPORT_PRIVATE_CONSTRUCTOR_H27