// Copyright (c) 2014 // INRIA Saclay-Ile de France (France) // // This file is part of CGAL (www.cgal.org); you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public License as // published by the Free Software Foundation; either version 3 of the License, // or (at your option) any later version. // // Licensees holding a valid commercial license may use this file in // accordance with the commercial license agreement provided with the software. // // This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE // WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. // // $URL$ // $Id$ // SPDX-License-Identifier: LGPL-3.0+ // // Author(s) : Marc Glisse #ifndef CGAL_STATIC_INT_H #define CGAL_STATIC_INT_H #include namespace CGAL { template struct static_zero { operator NT() const { return constant(); } }; template struct static_one { operator NT() const { return constant(); } }; template static_zero operator-(static_zero) { return static_zero(); } template NT operator+(NT const& x, static_zero) { return x; } template NT operator+(static_zero, NT const& x) { return x; } template static_zero operator+(static_zero, static_zero) { return static_zero(); } template static_one operator+(static_zero, static_one) { return static_one(); } template static_one operator+(static_one, static_zero) { return static_one(); } template NT operator-(NT const& x, static_zero) { return x; } template NT operator-(static_zero, NT const& x) { return -x; } template static_zero operator-(static_zero, static_zero) { return static_zero(); } template static_zero operator-(static_one, static_one) { return static_zero(); } template static_one operator-(static_one, static_zero) { return static_one(); } template NT operator*(NT const& x, static_one) { return x; } template NT operator*(static_one, NT const& x) { return x; } template static_zero operator*(NT const&, static_zero) { return static_zero(); } template static_zero operator*(static_zero, NT const&) { return static_zero(); } template static_zero operator*(static_zero, static_zero) { return static_zero(); } template static_one operator*(static_one, static_one) { return static_one(); } template static_zero operator*(static_zero, static_one) { return static_zero(); } template static_zero operator*(static_one, static_zero) { return static_zero(); } template NT operator/(NT const& x, static_one) { return x; } template static_zero operator/(static_zero, NT const&) { return static_zero(); } template static_zero operator/(static_zero, static_one) { return static_zero(); } template static_one operator/(static_one, static_one) { return static_one(); } } #endif // CGAL_STATIC_INT_H