[libsigcplusplus/variadic_mem_fun3: 12/148] adaptor_trait.h: Use this as a regular .h file.



commit 9987131083a716dd4fdbf0fa980897c369717bc1
Author: Murray Cumming <murrayc murrayc com>
Date:   Thu Jan 7 18:09:15 2016 +0100

    adaptor_trait.h: Use this as a regular .h file.
    
    Instead of generating it from a .h.m4 file.

 sigc++/.gitignore                                  |    1 -
 .../{macros/adaptor_trait.h.m4 => adaptor_trait.h} |   75 ++++++++------------
 sigc++/filelist.am                                 |    5 +-
 3 files changed, 32 insertions(+), 49 deletions(-)
---
diff --git a/sigc++/.gitignore b/sigc++/.gitignore
index 911443b..f5a5d8d 100644
--- a/sigc++/.gitignore
+++ b/sigc++/.gitignore
@@ -1,6 +1,5 @@
 /limit_reference.h
 /signal.h
-/adaptors/adaptor_trait.h
 /adaptors/bind.h
 /adaptors/bind_return.h
 /adaptors/compose.h
diff --git a/sigc++/adaptors/macros/adaptor_trait.h.m4 b/sigc++/adaptors/adaptor_trait.h
similarity index 83%
rename from sigc++/adaptors/macros/adaptor_trait.h.m4
rename to sigc++/adaptors/adaptor_trait.h
index 5d6a0aa..5199d91 100644
--- a/sigc++/adaptors/macros/adaptor_trait.h.m4
+++ b/sigc++/adaptors/adaptor_trait.h
@@ -1,49 +1,7 @@
-dnl Copyright 2002, The libsigc++ Development Team
-dnl
-dnl This library is free software; you can redistribute it and/or
-dnl modify it under the terms of the GNU Lesser General Public
-dnl License as published by the Free Software Foundation; either
-dnl version 2.1 of the License, or (at your option) any later version.
-dnl
-dnl This library is distributed in the hope that it will be useful,
-dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
-dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-dnl Lesser General Public License for more details.
-dnl
-dnl You should have received a copy of the GNU Lesser General Public
-dnl License along with this library; if not, write to the Free Software
-dnl Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-dnl
-divert(-1)
-include(template.macros.m4)
-
-dnl
-dnl The idea here is simple.  To prevent the need to
-dnl specializing every adaptor for every type of functor
-dnl and worse non-functors like function pointers, we
-dnl will make an adaptor trait which can take ordinary
-dnl functors and make them adaptor functors for which
-dnl we will of course be able to avoid excess copies.
-dnl (in theory)
-dnl
-dnl this all depends on partial specialization to allow
-dnl us to do
-dnl   functor_.template operator() <types> (args);
-dnl
-
-dnl I don't understand much of the above. However, I can
-dnl see that adaptors are implemented like they are because
-dnl there is no way to extract the return type and the argument
-dnl types from a functor type. Therefore, operator() is templated.
-dnl It's instatiated in slot_call#<>::operator() where the
-dnl argument types are known. The return type is finally determined
-dnl via the callof<> template - a tricky way to detect the return
-dnl type of a functor when the argument types are known. Martin.
-
-])
-
-divert(0)dnl
-_FIREWALL([ADAPTORS_ADAPTOR_TRAIT])
+// -*- c++ -*-
+/* Do not edit! -- generated file */
+#ifndef _SIGC_ADAPTORS_ADAPTOR_TRAIT_H_
+#define _SIGC_ADAPTORS_ADAPTOR_TRAIT_H_
 #include <sigc++config.h> //To get SIGC_TEMPLATE_KEYWORD_OPERATOR_OVERLOAD
 #include <sigc++/visit_each.h>
 #include <sigc++/functors/functor_trait.h>
@@ -51,6 +9,30 @@ _FIREWALL([ADAPTORS_ADAPTOR_TRAIT])
 #include <sigc++/functors/mem_fun.h>
 #include <sigc++/adaptors/deduce_result_type.h>
 
+/*
+ * The idea here is simple.  To prevent the need to
+ * specializing every adaptor for every type of functor
+ * and worse non-functors like function pointers, we
+ * will make an adaptor trait which can take ordinary
+ * functors and make them adaptor functors for which
+ * we will of course be able to avoid excess copies.
+ * (in theory)
+ *
+ * this all depends on partial specialization to allow
+ * us to do
+ *   functor_.template operator() <types> (args);
+ *
+ *
+ * I don't understand much of the above. However, I can
+ * see that adaptors are implemented like they are because
+ * there is no way to extract the return type and the argument
+ * types from a functor type. Therefore, operator() is templated.
+ * It's instatiated in slot_call#<>::operator() where the
+ * argument types are known. The return type is finally determined
+ * via the callof<> template - a tricky way to detect the return
+ * type of a functor when the argument types are known. Martin.
+ */
+ 
 namespace sigc {
 
 // Call either operator()<>() or sun_forte_workaround<>(),
@@ -315,3 +297,4 @@ struct adapts : public adaptor_base
 };
 
 } /* namespace sigc */
+#endif /* _SIGC_ADAPTORS_ADAPTOR_TRAIT_H_ */
diff --git a/sigc++/filelist.am b/sigc++/filelist.am
index aa051a1..33e8ff3 100644
--- a/sigc++/filelist.am
+++ b/sigc++/filelist.am
@@ -26,11 +26,11 @@ functors_built_cc =
 functors_built_h = slot.h mem_fun.h
 
 # Adaptors (adaptors/)
-adaptors_m4 = deduce_result_type.h.m4 adaptor_trait.h.m4 bind.h.m4 bind_return.h.m4 \
+adaptors_m4 = deduce_result_type.h.m4 bind.h.m4 bind_return.h.m4 \
              retype_return.h.m4 hide.h.m4 retype.h.m4 compose.h.m4 exception_catch.h.m4 \
              track_obj.h.m4
 adaptors_built_cc =
-adaptors_built_h = deduce_result_type.h adaptor_trait.h bind.h bind_return.h \
+adaptors_built_h = deduce_result_type.h bind.h bind_return.h \
                    retype_return.h hide.h retype.h compose.h exception_catch.h \
                    track_obj.h
 
@@ -65,6 +65,7 @@ sigc_public_h =                               \
        type_traits.h                   \
        visit_each.h                    \
        adaptors/adaptors.h             \
+       adaptors/adaptor_trait.h                \
        adaptors/bound_argument.h       \
        functors/functor_trait.h                \
        functors/functors.h             \


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]