Boost logo

Boost-Commit :

From: srajko_at_[hidden]
Date: 2007-07-09 23:09:36


Author: srajko
Date: 2007-07-09 23:09:35 EDT (Mon, 09 Jul 2007)
New Revision: 7403
URL: http://svn.boost.org/trac/boost/changeset/7403

Log:
fix bugs on MSVC8 - has_result_type is no longer based on MPL but on own trait, unfused_inherited::result no longer has second template argument.

Text files modified:
   sandbox/SOC/2007/signals/boost/signal_network/component/detail/unfused_inherited.hpp | 6
   sandbox/SOC/2007/signals/boost/signal_network/component/storage.hpp | 33 ++++--
   sandbox/SOC/2007/signals/boost/signal_network/component/traits.hpp | 2
   sandbox/SOC/2007/signals/boost/signal_network/connection/detail/result_of_defined.hpp | 14 ++
   sandbox/SOC/2007/signals/libs/signal_network/build/vc8ide/build.vcproj | 186 ++++++++++++++++++++++++++++++---------
   sandbox/SOC/2007/signals/libs/signal_network/build/vc8ide/doc.vcproj | 26 +++--
   sandbox/SOC/2007/signals/libs/signal_network/build/vc8ide/test.vcproj | 10 +
   sandbox/SOC/2007/signals/libs/signal_network/test/test_filter.cpp | 17 ++
   sandbox/SOC/2007/signals/libs/signal_network/test/test_result_of_defined.cpp | 12 ++
   9 files changed, 227 insertions(+), 79 deletions(-)

Modified: sandbox/SOC/2007/signals/boost/signal_network/component/detail/unfused_inherited.hpp
==============================================================================
--- sandbox/SOC/2007/signals/boost/signal_network/component/detail/unfused_inherited.hpp (original)
+++ sandbox/SOC/2007/signals/boost/signal_network/component/detail/unfused_inherited.hpp 2007-07-09 23:09:35 EDT (Mon, 09 Jul 2007)
@@ -98,11 +98,11 @@
             : Function(t1, t2)
         { }
 
- template<typename F, typename Enable=void>
- struct result;
+/* template<typename F, typename Enable=void>
+ struct result;*/
         
         template<typename F>
- struct result<F>
+ struct result//<F>
             : public Function::template result<F> {};
         
         template<typename F>

Modified: sandbox/SOC/2007/signals/boost/signal_network/component/storage.hpp
==============================================================================
--- sandbox/SOC/2007/signals/boost/signal_network/component/storage.hpp (original)
+++ sandbox/SOC/2007/signals/boost/signal_network/component/storage.hpp 2007-07-09 23:09:35 EDT (Mon, 09 Jul 2007)
@@ -17,6 +17,14 @@
 
 namespace boost { namespace signals {
 
+ template<typename Signature,
+ typename OutSignal,
+ typename Combiner,
+ typename Group,
+ typename GroupCompare
+>
+class storage;
+
 namespace detail
 {
     struct make_ref
@@ -35,7 +43,10 @@
             return t;
         }
     };
-
+}
+// storage_modifier should be in the detail namespace, but MSVC complains when
+// making boost::signals::storage a friend.
+
     template <typename Signature>
     class storage_modifier
     {
@@ -65,6 +76,9 @@
             else
                 return typename result<storage_modifier(const T1 &)>::type ();
         }
+ const storable_vector &stored_vector() {return stored;}
+ void open() {opened = true;}
+ void close() {opened = false;}
     protected:
         storable_vector stored;
         volatile bool opened;
@@ -72,7 +86,7 @@
         template<typename Sig, typename OutSignal, typename Combiner, typename Group, typename GroupCompare>
         friend class storage;
     };
-}
+
 
 /** \brief Stores and transmits arguments received from a signal.
     \param Signature Signature of the signal sent.
@@ -83,15 +97,15 @@
     typename Group = int,
     typename GroupCompare = std::less<Group>
>
-class storage : public conditional_modifier<detail::storage_modifier<Signature>, Signature, OutSignal, Combiner, Group, GroupCompare>
+class storage : public conditional_modifier<storage_modifier<Signature>, Signature, OutSignal, Combiner, Group, GroupCompare>
 {
 protected:
- typedef conditional_modifier<detail::storage_modifier<Signature>, Signature, OutSignal, Combiner, Group, GroupCompare> base_type;
+ typedef conditional_modifier<storage_modifier<Signature>, Signature, OutSignal, Combiner, Group, GroupCompare> base_type;
 public:
- typedef typename detail::storage_modifier<Signature>::parameter_types parameter_types;
+ typedef typename storage_modifier<Signature>::parameter_types parameter_types;
 
- typedef typename detail::storage_modifier<Signature>::storable_types storable_types;
- typedef typename detail::storage_modifier<Signature>::storable_vector storable_vector;
+ typedef typename storage_modifier<Signature>::storable_types storable_types;
+ typedef typename storage_modifier<Signature>::storable_vector storable_vector;
 
     /** Initializes the stored parameter values using the provided sequence.
         \param[in] seq Sequence from which the stored parameter sequence is initialized from.
@@ -102,8 +116,8 @@
         */
     storage() {}
     
- void open() {base_type::member.opened = true;}
- void close() {base_type::member.opened = false;}
+ void open() {base_type::member.open();}
+ void close() {base_type::member.close();}
 
     /** Sends a signal containing the stored parameter values.
         \return Return value of the sent signal.
@@ -185,7 +199,6 @@
     }
 protected:
     storable_vector &stored() {return base_type::modification.stored;}
-
 };
 
 } } // namespace boost::signals

Modified: sandbox/SOC/2007/signals/boost/signal_network/component/traits.hpp
==============================================================================
--- sandbox/SOC/2007/signals/boost/signal_network/component/traits.hpp (original)
+++ sandbox/SOC/2007/signals/boost/signal_network/component/traits.hpp 2007-07-09 23:09:35 EDT (Mon, 09 Jul 2007)
@@ -25,7 +25,7 @@
     typedef typename T::signal_type type;
 };
 
-template<typename T, typename Signature, typename Enable=void>
+template<typename Signature, typename T, typename Enable=void>
 struct get_slot;
 
 } } // namespace boost::signals

Modified: sandbox/SOC/2007/signals/boost/signal_network/connection/detail/result_of_defined.hpp
==============================================================================
--- sandbox/SOC/2007/signals/boost/signal_network/connection/detail/result_of_defined.hpp (original)
+++ sandbox/SOC/2007/signals/boost/signal_network/connection/detail/result_of_defined.hpp 2007-07-09 23:09:35 EDT (Mon, 09 Jul 2007)
@@ -11,7 +11,7 @@
 #include <boost/function_types/function_type.hpp>
 #include <boost/function_types/parameter_types.hpp>
 #include <boost/function_types/result_type.hpp>
-#include <boost/mpl/has_xxx.hpp>
+//#include <boost/mpl/has_xxx.hpp>
 #include <boost/mpl/or.hpp>
 #include <boost/mpl/pop_front.hpp>
 #include <boost/mpl/push_front.hpp>
@@ -22,7 +22,13 @@
     
 namespace detail {
 
- BOOST_MPL_HAS_XXX_TRAIT_DEF(result_type)
+// BOOST_MPL_HAS_XXX_TRAIT_DEF(result_type)
+ template<typename T, typename Enable=void>
+ struct has_result_type : public boost::false_type {};
+
+ template<typename T>
+ struct has_result_type<T, typename detail::enable_if_defined<typename T::result_type>::type>
+ : public boost::true_type {};
 
     template<typename F, typename FArgs, typename Enable=void>
     struct result_defined : public boost::false_type {};
@@ -35,8 +41,8 @@
     struct result_of_defined : public boost::false_type {};
 
     template<typename T>
- struct result_of_defined<T, typename boost::enable_if<typename
- boost::mpl::or_<
+ struct result_of_defined<T, typename boost::enable_if<
+ typename boost::mpl::or_<
             has_result_type<typename boost::function_types::result_type<T>::type>,
             result_defined<typename boost::function_types::result_type<T>::type, T>
>::type

Modified: sandbox/SOC/2007/signals/libs/signal_network/build/vc8ide/build.vcproj
==============================================================================
--- sandbox/SOC/2007/signals/libs/signal_network/build/vc8ide/build.vcproj (original)
+++ sandbox/SOC/2007/signals/libs/signal_network/build/vc8ide/build.vcproj 2007-07-09 23:09:35 EDT (Mon, 09 Jul 2007)
@@ -61,51 +61,7 @@
                         Name="signal_network"
>
                         <File
- RelativePath="..\..\..\..\boost\signal_network\base.hpp"
- >
- </File>
- <File
- RelativePath="..\..\..\..\boost\signal_network\chain.hpp"
- >
- </File>
- <File
- RelativePath="..\..\..\..\boost\signal_network\filter.hpp"
- >
- </File>
- <File
- RelativePath="..\..\..\..\boost\signal_network\function.hpp"
- >
- </File>
- <File
- RelativePath="..\..\..\..\boost\signal_network\junction.hpp"
- >
- </File>
- <File
- RelativePath="..\..\..\..\boost\signal_network\mutex.hpp"
- >
- </File>
- <File
- RelativePath="..\..\..\..\boost\signal_network\selector.hpp"
- >
- </File>
- <File
- RelativePath="..\..\..\..\boost\signal_network\signal_network.hpp"
- >
- </File>
- <File
- RelativePath="..\..\..\..\boost\signal_network\socket_receiver.hpp"
- >
- </File>
- <File
- RelativePath="..\..\..\..\boost\signal_network\socket_sender.hpp"
- >
- </File>
- <File
- RelativePath="..\..\..\..\boost\signal_network\storage.hpp"
- >
- </File>
- <File
- RelativePath="..\..\..\..\boost\signal_network\timed_generator.hpp"
+ RelativePath="..\..\..\..\boost\signal_network\connection.hpp"
>
                         </File>
                         <Filter
@@ -156,6 +112,146 @@
>
                                 </File>
                         </Filter>
+ <Filter
+ Name="connection"
+ >
+ <File
+ RelativePath="..\..\..\..\boost\signal_network\connection\connect.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\boost\signal_network\connection\operators.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\boost\signal_network\connection\signal.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\boost\signal_network\connection\slot_selector.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\boost\signal_network\connection\slot_selector_map.hpp"
+ >
+ </File>
+ <Filter
+ Name="detail"
+ >
+ <File
+ RelativePath="..\..\..\..\boost\signal_network\connection\detail\bind_object.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\boost\signal_network\connection\detail\replace_return_type.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\boost\signal_network\connection\detail\result_of_defined.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\boost\signal_network\connection\detail\slot_type.hpp"
+ >
+ </File>
+ </Filter>
+ </Filter>
+ <Filter
+ Name="component"
+ >
+ <File
+ RelativePath="..\..\..\..\boost\signal_network\component\applicator.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\boost\signal_network\component\chain.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\boost\signal_network\component\conditional.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\boost\signal_network\component\conditional_modifier.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\boost\signal_network\component\counter.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\boost\signal_network\component\filter.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\boost\signal_network\component\filter_base.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\boost\signal_network\component\function.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\boost\signal_network\component\instantiator.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\boost\signal_network\component\junction.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\boost\signal_network\component\modifier.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\boost\signal_network\component\mutex.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\boost\signal_network\component\selector.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\boost\signal_network\component\socket_receiver.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\boost\signal_network\component\socket_sender.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\boost\signal_network\component\storage.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\boost\signal_network\component\timed_generator.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\boost\signal_network\component\traits.hpp"
+ >
+ </File>
+ <Filter
+ Name="detail"
+ >
+ <File
+ RelativePath="..\..\..\..\boost\signal_network\component\detail\generic_template.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\boost\signal_network\component\detail\serialize_fusion_vector.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\boost\signal_network\component\detail\storable.hpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\..\boost\signal_network\component\detail\unfused_inherited.hpp"
+ >
+ </File>
+ </Filter>
+ </Filter>
                 </Filter>
                 <Filter
                         Name="solution build"

Modified: sandbox/SOC/2007/signals/libs/signal_network/build/vc8ide/doc.vcproj
==============================================================================
--- sandbox/SOC/2007/signals/libs/signal_network/build/vc8ide/doc.vcproj (original)
+++ sandbox/SOC/2007/signals/libs/signal_network/build/vc8ide/doc.vcproj 2007-07-09 23:09:35 EDT (Mon, 09 Jul 2007)
@@ -39,22 +39,26 @@
         <References>
         </References>
         <Files>
- <Filter
- Name="Source Files"
+ <File
+ RelativePath="..\..\doc\components.qbk"
+ >
+ </File>
+ <File
+ RelativePath="..\..\doc\connections.qbk"
>
- <File
- RelativePath="..\..\doc\dox\signal_network.hpp"
- >
- </File>
- <File
- RelativePath="..\..\doc\signal_network.qbk"
- >
- </File>
- </Filter>
+ </File>
+ <File
+ RelativePath="..\..\doc\introduction.qbk"
+ >
+ </File>
                 <File
                         RelativePath="..\..\doc\Jamfile.v2"
>
                 </File>
+ <File
+ RelativePath="..\..\doc\signal_network.qbk"
+ >
+ </File>
         </Files>
         <Globals>
         </Globals>

Modified: sandbox/SOC/2007/signals/libs/signal_network/build/vc8ide/test.vcproj
==============================================================================
--- sandbox/SOC/2007/signals/libs/signal_network/build/vc8ide/test.vcproj (original)
+++ sandbox/SOC/2007/signals/libs/signal_network/build/vc8ide/test.vcproj 2007-07-09 23:09:35 EDT (Mon, 09 Jul 2007)
@@ -60,7 +60,7 @@
         </References>
         <Files>
                 <File
- RelativePath="..\..\test\Jamfile.v2"
+ RelativePath="..\..\test\test_bind_object.cpp"
>
                 </File>
                 <File
@@ -72,6 +72,10 @@
>
                 </File>
                 <File
+ RelativePath="..\..\test\test_connect.cpp"
+ >
+ </File>
+ <File
                         RelativePath="..\..\test\test_connections.cpp"
>
                 </File>
@@ -116,6 +120,10 @@
>
                 </File>
                 <File
+ RelativePath="..\..\test\test_result_of_defined.cpp"
+ >
+ </File>
+ <File
                         RelativePath="..\..\test\test_same_type.cpp"
>
                 </File>

Modified: sandbox/SOC/2007/signals/libs/signal_network/test/test_filter.cpp
==============================================================================
--- sandbox/SOC/2007/signals/libs/signal_network/test/test_filter.cpp (original)
+++ sandbox/SOC/2007/signals/libs/signal_network/test/test_filter.cpp 2007-07-09 23:09:35 EDT (Mon, 09 Jul 2007)
@@ -8,7 +8,6 @@
 #include <boost/signal_network/connection.hpp>
 
 #include <boost/fusion/sequence/intrinsic/at.hpp>
-#include <boost/type_traits/is_object.hpp>
 
 #include <boost/test/included/test_exec_monitor.hpp>
 
@@ -19,9 +18,11 @@
 class DoublerClass : public signals::filter<void (float), signals::unfused>
 {
 public:
- typedef signals::filter<void (float), signals::unfused>::signal_type signal_type;
     template<typename FArgs>
- struct result
+ struct result;
+
+ template<typename F>
+ struct result<F(float)>
     {
         typedef void type;
     };
@@ -32,7 +33,15 @@
 class FusedDoublerClass : public signals::filter<void (float), signals::fused>
 {
 public:
- typedef void result_type;
+ template<typename FArgs>
+ struct result;
+
+ template<typename F>
+ struct result<F(const fusion::vector<float> &)>
+ {
+ typedef void type;
+ };
+
     void operator()(const fusion::vector<float> &x)
     {
         // this could be more general but I'm having problems with the general approach...

Modified: sandbox/SOC/2007/signals/libs/signal_network/test/test_result_of_defined.cpp
==============================================================================
--- sandbox/SOC/2007/signals/libs/signal_network/test/test_result_of_defined.cpp (original)
+++ sandbox/SOC/2007/signals/libs/signal_network/test/test_result_of_defined.cpp 2007-07-09 23:09:35 EDT (Mon, 09 Jul 2007)
@@ -6,6 +6,7 @@
 #include <boost/signal_network/connection/detail/result_of_defined.hpp>
 #include <boost/fusion/sequence/container/map.hpp>
 #include <boost/signal_network/component/junction.hpp>
+#include <boost/signal_network/component/storage.hpp>
 
 #include <boost/test/included/test_exec_monitor.hpp>
 
@@ -37,6 +38,17 @@
 // bool value = signals::detail::result_of_defined<fusion::map<>(void)>::value;
     BOOST_CHECK(!signals::detail::result_of_defined<fusion::map<>(int)>::value);
     BOOST_CHECK(!signals::detail::result_of_defined<fusion::map<>()>::value);
+ typedef boost::fusion::map<
+ boost::fusion::pair<
+ void (void),
+ boost::signals::slot_selector<void (void),boost::signals::storage<void (float),boost::signals::unfused> >
+ >,
+ boost::fusion::pair<
+ void (const boost::fusion::vector<> &),
+ boost::signals::slot_selector<void (const boost::fusion::vector<> &),boost::signals::storage<void (float),boost::signals::unfused> >
+ >
+ > send_slot_map_type;
+ BOOST_CHECK(!signals::detail::result_of_defined<send_slot_map_type()>::value);
     BOOST_CHECK(!signals::detail::result_of_defined<nothing(int)>::value);
     BOOST_CHECK(!signals::detail::result_of_defined<nothing()>::value);
     BOOST_CHECK(signals::detail::result_of_defined<has_result_type(int)>::value);


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk