[libsigc++2] Remove deprecated sigc::lambda API that is only in headers.
- From: Murray Cumming <murrayc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libsigc++2] Remove deprecated sigc::lambda API that is only in headers.
- Date: Fri, 17 Jul 2015 11:12:14 +0000 (UTC)
commit b90ba6182cee574c465a7efa91af7d0c3571717d
Author: Murray Cumming <murrayc murrayc com>
Date: Fri Jul 17 13:11:47 2015 +0200
Remove deprecated sigc::lambda API that is only in headers.
So this is an API removal (of deprecated API) but not an ABI change.
The remaining deprecated API in the headers is needed by the definitions
in lambda.cc.m4.
Bug #672555
sigc++/adaptors/adaptors.h | 1 -
sigc++/adaptors/lambda/lambda.h | 28 --
sigc++/adaptors/lambda/macros/base.h.m4 | 194 ---------
sigc++/adaptors/lambda/macros/group.h.m4 | 221 -----------
sigc++/adaptors/lambda/macros/lambda.cc.m4 | 1 +
sigc++/adaptors/lambda/macros/operator.h.m4 | 564 ---------------------------
sigc++/adaptors/lambda/macros/select.h.m4 | 1 -
sigc++/filelist.am | 5 +-
sigc++/sigc++.h | 4 +-
tests/Makefile.am | 1 -
tests/test_lambda.cc | 264 -------------
11 files changed, 5 insertions(+), 1279 deletions(-)
---
diff --git a/sigc++/adaptors/adaptors.h b/sigc++/adaptors/adaptors.h
index ef484a4..2353890 100644
--- a/sigc++/adaptors/adaptors.h
+++ b/sigc++/adaptors/adaptors.h
@@ -28,6 +28,5 @@
#include <sigc++/adaptors/compose.h>
#include <sigc++/adaptors/exception_catch.h>
#include <sigc++/adaptors/track_obj.h>
-#include <sigc++/adaptors/lambda/lambda.h>
#endif /* _SIGC_ADAPTOR_HPP_ */
diff --git a/sigc++/adaptors/lambda/macros/base.h.m4 b/sigc++/adaptors/lambda/macros/base.h.m4
index 2ff91f4..82790c4 100644
--- a/sigc++/adaptors/lambda/macros/base.h.m4
+++ b/sigc++/adaptors/lambda/macros/base.h.m4
@@ -146,52 +146,9 @@ FOR(1,CALL_SIZE,[[LAMBDA_DO(%1)]])dnl
T_type value_;
};
-template <class T_type>
-typename lambda_core<T_type, true>::result_type
-lambda_core<T_type, true>::operator()() const
- { return value_(); }
-
-/** Abstracts lambda functionality (template specialization for other value types).
- *
- * @deprecated Use C++11 lambda expressions instead.
- *
- * @ingroup lambdas
- */
-template <class T_type>
-struct lambda_core<T_type, false> : public lambda_base
-{
- template <LOOP(class T_arg%1=void,CALL_SIZE)>
- struct deduce_result_type
- { typedef T_type type; };
- typedef T_type result_type; // all operator() overloads return T_type.
- typedef lambda<T_type> lambda_type;
-
- result_type operator()() const;
-
-FOR(1,CALL_SIZE,[[LAMBDA_DO_VALUE(%1)]])dnl
- explicit lambda_core(typename type_trait<T_type>::take v)
- : value_(v) {}
-
- T_type value_;
-};
-
-template <class T_type>
-typename lambda_core<T_type, false>::result_type lambda_core<T_type, false>::operator()() const
- { return value_; }
} /* namespace internal */
-//template specialization of visitor<>::do_visit_each<>(action, functor):
-template <class T_functor, bool I_islambda>
-struct visitor<internal::lambda_core<T_functor, I_islambda> >
-{
- template <class T_action>
- static void do_visit_each(const T_action& _A_action,
- const internal::lambda_core<T_functor, I_islambda>& _A_target)
- {
- sigc::visit_each(_A_action, _A_target.value_);
- }
-};
// forward declarations for lambda operators other<subscript> and other<assign>
template <class T_type>
@@ -206,39 +163,6 @@ template <class T_type>
struct unwrap_lambda_type;
#endif // DOXYGEN_SHOULD_SKIP_THIS
-/** Gets the object stored inside a lambda object.
- * Returns the object passed as argument, if it is not of type lambda.
- *
- * @deprecated Use C++11 lambda expressions instead of libsigc++ lambdas.
- *
- * @ingroup lambdas
- */
-template <class T_type>
-T_type& unwrap_lambda_value(T_type& a)
-{ return a; }
-
-/** Gets the object stored inside a lambda object.
- * Returns the object passed as argument, if it is not of type lambda.
- *
- * @deprecated Use C++11 lambda expressions instead of libsigc++ lambdas.
- *
- * @ingroup lambdas
- */
-template <class T_type>
-const T_type& unwrap_lambda_value(const T_type& a)
-{ return a; }
-
-/** Gets the object stored inside a lambda object.
- *
- * @deprecated Use C++11 lambda expressions instead of libsigc++ lambdas.
- *
- * @ingroup lambdas
- */
-template <class T_type>
-const T_type& unwrap_lambda_value(const lambda<T_type>& a)
-{ return a.value_; }
-
-
/** Lambda type.
* Objects of this type store a value that may be of type lambda itself.
* In this case, operator()() executes the lambda (a lambda is always a functor at the same time).
@@ -276,124 +200,6 @@ struct lambda : public internal::lambda_core<T_type>
return lambda<lambda_operator_type>(lambda_operator_type(this->value_, unwrap_lambda_value(a))); }
};
-#ifndef DOXYGEN_SHOULD_SKIP_THIS
-//template specialization of visitor<>::do_visit_each<>(action, functor):
-template <class T_type>
-struct visitor<lambda<T_type> >
-{
- template <class T_action>
- static void do_visit_each(const T_action& _A_action,
- const lambda<T_type>& _A_target)
- {
- sigc::visit_each(_A_action, _A_target.value_);
- }
-};
-#endif // DOXYGEN_SHOULD_SKIP_THIS
-
-dnl /* With the Sun FORTE and the Compaq C++ compiler,
-dnl * sigc::var() doesn't work with string constants.
-dnl * Some work-araound is needed to convert 'const (&) char[N]'
-dnl * into 'const char*'. The following work-around works with gcc
-dnl * but neither with the Sun FORTE nor with the Compaq C++ compiler
-dnl * (for the gcc the work-around is not needed, anyway):
-dnl */
-dnl namespace internal {
-dnl
-dnl template <class T_type>
-dnl struct convert_array
-dnl { typedef T_type& type; };
-dnl
-dnl template <class T_type, int N>
-dnl struct convert_array<T_type[[N]]>
-dnl { typedef T_type* type; };
-dnl
-dnl } /* namespace internal */
-dnl
-dnl /// Converts a constant variable into a lambda object.
-dnl template <class T_type>
-dnl lambda<T_type> constant(const T_type& v)
-dnl { return lambda<T_type>(v); }
-dnl
-dnl /// Converts a reference into a lambda object.
-dnl template <class T_type>
-dnl lambda<typename internal::convert_array<T_type>::type> var(T_type& v)
-dnl { return lambda<typename internal::convert_array<T_type>::type>(v); }
-dnl
-dnl /// Converts a constant reference into a lambda object.
-dnl template <class T_type>
-dnl lambda<typename internal::convert_array<const T_type>::type> var(const T_type& v)
-dnl { return lambda<typename internal::convert_array<const T_type>::type>(v); }
-
-/** Converts a reference into a lambda object.
- * sigc::var creates a 0-ary functor, returning the value of a referenced variable.
- *
- * @par Example:
- * @code
- * int main(int argc, char* argv[])
- * {
- * int data;
- * sigc::signal<int> readValue;
- *
- * readValue.connect(sigc::var(data));
- *
- * data = 3;
- * std::cout << readValue() << std::endl; //Prints 3.
- *
- * data = 5;
- * std::cout << readValue() << std::endl; //Prints 5.
- * }
- * @endcode
- *
- * If you prefer to use C++11 lambda expressions, you can replace
- * @code
- * readValue.connect(sigc::var(data));
- * @endcode
- * in the example by
- * @code
- * readValue.connect([[&data]] () -> int { return data; });
- * @endcode
- *
- * @deprecated Use C++11 lambda expressions instead of libsigc++ lambdas.
- *
- * @ingroup lambdas
- */
-template <class T_type>
-lambda<T_type&> var(T_type& v)
-{ return lambda<T_type&>(v); }
-
-/** Converts a constant reference into a lambda object.
- *
- * @deprecated Use C++11 lambda expressions instead of libsigc++ lambdas.
- *
- * @ingroup lambdas
- */
-template <class T_type>
-lambda<const T_type&> var(const T_type& v)
-{ return lambda<const T_type&>(v); }
-
-
-/** Deduces the type of the object stored in an object of the passed lambda type.
- * If the type passed as template argument is not of lambda type,
- * type is defined to unwrap_reference<T_type>::type.
- *
- * @deprecated Use C++11 lambda expressions instead of libsigc++ lambdas.
- *
- * @ingroup lambdas
- */
-template <class T_type>
-struct unwrap_lambda_type
-{ typedef typename unwrap_reference<T_type>::type type; };
-
-/** Deduces the type of the object stored in an object of the passed lambda type.
- *
- * @deprecated Use C++11 lambda expressions instead of libsigc++ lambdas.
- *
- * @ingroup lambdas
- */
-template <class T_type>
-struct unwrap_lambda_type<lambda<T_type> >
-{ typedef T_type type; };
-
} /* namespace sigc */
_DEPRECATE_IFDEF_END
diff --git a/sigc++/adaptors/lambda/macros/lambda.cc.m4 b/sigc++/adaptors/lambda/macros/lambda.cc.m4
index 463bb82..fd7c6b7 100644
--- a/sigc++/adaptors/lambda/macros/lambda.cc.m4
+++ b/sigc++/adaptors/lambda/macros/lambda.cc.m4
@@ -23,6 +23,7 @@ _DEPRECATE_IFDEF_START
namespace sigc {
+//These are declared in select.h.
FOR(1,CALL_SIZE,[[const lambda<internal::lambda_select%1> _%1;
]])
} /* namespace sigc */
diff --git a/sigc++/adaptors/lambda/macros/select.h.m4 b/sigc++/adaptors/lambda/macros/select.h.m4
index ab295da..b92fc20 100644
--- a/sigc++/adaptors/lambda/macros/select.h.m4
+++ b/sigc++/adaptors/lambda/macros/select.h.m4
@@ -68,7 +68,6 @@ namespace internal {
FOR(1,CALL_SIZE,[[LAMBDA_SELECT(%1,CALL_SIZE)]])dnl
} /* namespace internal */
-FOR(1,CALL_SIZE,[[LAMBDA_SELECTOR(%1)]])dnl
} /* namespace sigc */
_DEPRECATE_IFDEF_END
diff --git a/sigc++/filelist.am b/sigc++/filelist.am
index b230902..d1f1a7b 100644
--- a/sigc++/filelist.am
+++ b/sigc++/filelist.am
@@ -38,9 +38,9 @@ adaptors_built_h = deduce_result_type.h adaptor_trait.h bind.h bind_return.h \
track_obj.h
# Lambda (adaptors/lambda)
-lambda_m4 = base.h.m4 select.h.m4 operator.h.m4 group.h.m4 lambda.cc.m4
+lambda_m4 = base.h.m4 select.h.m4 lambda.cc.m4
lambda_built_cc = lambda.cc
-lambda_built_h = base.h select.h operator.h group.h
+lambda_built_h = base.h select.h
# Combine all the above parts with right directories prefixed
sigc_m4 = $(base_m4:%=macros/%) \
@@ -69,6 +69,5 @@ sigc_public_h = \
visit_each.h \
adaptors/adaptors.h \
adaptors/bound_argument.h \
- adaptors/lambda/lambda.h \
functors/functors.h \
functors/slot_base.h
diff --git a/sigc++/sigc++.h b/sigc++/sigc++.h
index 6cced96..24d3424 100644
--- a/sigc++/sigc++.h
+++ b/sigc++/sigc++.h
@@ -31,7 +31,7 @@
* dissimilar callbacks.
*
* For instance, see the @ref signal "Signals", @ref sigcfunctors "Functors",
- * @ref slot "Slots", @ref adaptors "Adaptors", and @ref lambdas "Lambdas".
+ * @ref slot "Slots" and @ref adaptors "Adaptors".
*
* See also the
* <a href="http://libsigc.sourceforge.net/libsigc2/docs/manual/html/index.html">libsigc++ tutorial</a>,
@@ -50,7 +50,7 @@
* - Extensions do not require alteration of basic components
* - User-definable accumulators
* - A variety of adaptors to change the callback signature: bind, hide,
- * retype, compose and lambda call groups
+ * retype, and compose
*
* @section basics Basic Usage
*
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 6a53312..69eda2b 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -36,7 +36,6 @@ check_PROGRAMS = \
test_exception_catch \
test_functor_trait \
test_hide \
- test_lambda \
test_limit_reference \
test_mem_fun \
test_ptr_fun \
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]