From f55c8e9a2f894d131f9ed960aee7ab1fd8c2d649 Mon Sep 17 00:00:00 2001 From: Sylvain Pion Date: Fri, 10 Apr 2009 21:55:24 +0000 Subject: [PATCH] Renaming before documenting: Default_argument -> Default. --- .gitattributes | 2 +- Filtered_kernel/include/CGAL/Lazy.h | 6 +-- .../include/CGAL/Compact_container.h | 6 +-- .../CGAL/{Default_argument.h => Default.h} | 37 +++++++++---------- 4 files changed, 24 insertions(+), 27 deletions(-) rename STL_Extension/include/CGAL/{Default_argument.h => Default.h} (61%) diff --git a/.gitattributes b/.gitattributes index f36ab81fbbc..8745dd45424 100644 --- a/.gitattributes +++ b/.gitattributes @@ -3194,7 +3194,7 @@ Ridges_3/test/Ridges_3/data/ellipsoid.off -text svneol=unset#application/octet-s Robustness/demo/Robustness/help/index.html svneol=native#text/html STL_Extension/doc_tex/STL_Extension/plusplus.png -text STL_Extension/doc_tex/STL_Extension_ref/Uncertain.tex -text -STL_Extension/include/CGAL/Default_argument.h -text +STL_Extension/include/CGAL/Default.h -text STL_Extension/include/CGAL/array.h -text STL_Extension/include/CGAL/type_traits.h -text STL_Extension/test/STL_Extension/test_Uncertain.cpp -text diff --git a/Filtered_kernel/include/CGAL/Lazy.h b/Filtered_kernel/include/CGAL/Lazy.h index 299a7f90a64..2c5cdae8ed8 100644 --- a/Filtered_kernel/include/CGAL/Lazy.h +++ b/Filtered_kernel/include/CGAL/Lazy.h @@ -30,7 +30,7 @@ #include #include #include -#include +#include #ifdef CGAL_HAS_THREADS # include @@ -1684,7 +1684,7 @@ public: //____________________________________________________________ // The magic functor that has Lazy as result type -template +template struct Lazy_construction { static const bool Protection = true; @@ -1692,7 +1692,7 @@ struct Lazy_construction typedef typename LK::Approximate_kernel AK; typedef typename LK::Exact_kernel EK; typedef typename EK::FT EFT; - typedef typename If_default_argument::type E2A; + typedef typename Default::Get::type E2A; typedef typename AC::result_type AT; typedef typename EC::result_type ET; typedef Lazy Handle; diff --git a/STL_Extension/include/CGAL/Compact_container.h b/STL_Extension/include/CGAL/Compact_container.h index 58e467cf1df..b27684cae0b 100644 --- a/STL_Extension/include/CGAL/Compact_container.h +++ b/STL_Extension/include/CGAL/Compact_container.h @@ -21,7 +21,7 @@ #define CGAL_COMPACT_CONTAINER_H #include -#include +#include #include #include @@ -109,11 +109,11 @@ namespace CGALi { class CC_iterator; } -template < class T, class Allocator_ = Default_argument > +template < class T, class Allocator_ = Default > class Compact_container { typedef Allocator_ Al; - typedef typename If_default_argument::type Allocator; + typedef typename Default::Get< Al, CGAL_ALLOCATOR(T) >::type Allocator; typedef Compact_container Self; typedef Compact_container_traits Traits; public: diff --git a/STL_Extension/include/CGAL/Default_argument.h b/STL_Extension/include/CGAL/Default.h similarity index 61% rename from STL_Extension/include/CGAL/Default_argument.h rename to STL_Extension/include/CGAL/Default.h index 1c23a33ad75..2fdef22e721 100644 --- a/STL_Extension/include/CGAL/Default_argument.h +++ b/STL_Extension/include/CGAL/Default.h @@ -1,4 +1,4 @@ -// Copyright (c) 2007 INRIA Sophia-Antipolis (France). All rights reserved. +// Copyright (c) 2007,2009 INRIA Sophia-Antipolis (France). All rights reserved. // // 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 @@ -16,33 +16,30 @@ // // Author(s) : Sylvain Pion -#ifndef CGAL_DEFAULT_ARGUMENT_H -#define CGAL_DEFAULT_ARGUMENT_H +#ifndef CGAL_DEFAULT_H +#define CGAL_DEFAULT_H -// Default_argument is a tag that can be used to shrink mangled names and +namespace CGAL { + +// Default is a tag that can be used to shrink mangled names and // error messages in place of the default value of template arguments. // It could also be used by users to specify default values to arguments which // are not at the end of the argument list. // It can also be useful to easily break cyclic dependencies in templates. -// Maybe we should provide a macro to disable it so as to show the arguments? -// Maybe we could document it? -// If_default_argument is a helper class which helps using this scheme. +struct Default +{ + template + struct Get { + typedef Argument type; + }; -namespace CGAL { - -struct Default_argument; - -template < typename Argument, typename Default > -struct If_default_argument { - typedef Argument type; -}; - -template < typename Default > -struct If_default_argument { - typedef Default type; + template + struct Get { + typedef Value type; + }; }; } -#endif // CGAL_DEFAULT_ARGUMENT_H +#endif // CGAL_DEFAULT_H