From 16aaf4cda5fd97da12a7f1da8b0a5168fac2e289 Mon Sep 17 00:00:00 2001 From: vrouvrea Date: Tue, 11 Oct 2016 13:57:03 +0000 Subject: Problem of merge with tangentialcomplex branch. Redo in an integration branch git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/branches/tangential_integration@1701 636b058d-ea47-450e-bf9e-a15bfbe3eedb Former-commit-id: fa029e8e90b3e203ea675f02098ec6fe95596f9f --- src/common/include/gudhi_patches/CGAL/typeset.h | 117 ++++++++++++++++++++++++ 1 file changed, 117 insertions(+) create mode 100644 src/common/include/gudhi_patches/CGAL/typeset.h (limited to 'src/common/include/gudhi_patches/CGAL/typeset.h') diff --git a/src/common/include/gudhi_patches/CGAL/typeset.h b/src/common/include/gudhi_patches/CGAL/typeset.h new file mode 100644 index 00000000..d4e24281 --- /dev/null +++ b/src/common/include/gudhi_patches/CGAL/typeset.h @@ -0,0 +1,117 @@ +// 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$ +// +// Author(s) : Marc Glisse + +#ifndef CGAL_TYPESET_H +#define CGAL_TYPESET_H +#include +#ifdef CGAL_CXX11 +#include +#else +#include +#endif + +// Sometimes using tuple just to list types is overkill (takes forever to +// instantiate). + +namespace CGAL { +#ifdef CGAL_CXX11 + template struct typeset; + template struct typeset { + typedef H head; + typedef typeset tail; + typedef typeset type; + template using contains = typename + std::conditional< + std::is_same::value, + std::true_type, + typename tail::template contains + >::type; + template using add = typename + std::conditional< + contains::value, + typeset, + typeset + >::type; + }; + template<> struct typeset<> { + typedef typeset type; + template using contains = std::false_type; + template using add = typeset; + }; +#else + template struct typeset; + template, void, typeset >::type > + struct typeset { + typedef typeset type; + typedef H head; + typedef T tail; + template struct contains : + boost::mpl::if_,boost::true_type,typename tail::template contains >::type + {}; + template struct add; + //boost::mpl::if_,typeset,typeset >::type + }; + template<> struct typeset<> { + typedef typeset type; + template struct contains : boost::false_type {}; + template struct add : CGAL::typeset {}; + }; + + template + template + struct typeset::add : typeset::type> {}; + template + template + struct typeset::add : typeset {}; +#endif + + template struct typeset_union_ : + typeset_union_::type, typename T2::tail> + {}; + template struct typeset_union_ > : T {}; + + template + struct typeset_intersection_ { + typedef typename T1::head H; + typedef typename typeset_intersection_::type U; + typedef typename +#ifdef CGAL_CXX11 + std::conditional::value, +#else + boost::mpl::if_, +#endif + typename U::template add::type, U>::type type; + }; + template + struct typeset_intersection_,T> : typeset<> {}; + +#ifdef CGAL_CXX11 + template + using typeset_union = typename typeset_union_::type; + template + using typeset_intersection = typename typeset_intersection_::type; +#else + template + struct typeset_union : typeset_union_::type {}; + template + struct typeset_intersection : typeset_intersection_::type {}; +#endif +} +#endif -- cgit v1.2.3