linuxdcpp-team team mailing list archive
-
linuxdcpp-team team
-
Mailing list archive
-
Message #05135
[Branch ~dcplusplus-team/dcplusplus/trunk] Rev 2783: replace the boost if with std::conditional
------------------------------------------------------------
revno: 2783
committer: poy <poy@xxxxxxxxxx>
branch nick: trunk
timestamp: Sun 2012-01-01 19:19:59 +0100
message:
replace the boost if with std::conditional
modified:
dcpp/GetSet.h
--
lp:dcplusplus
https://code.launchpad.net/~dcplusplus-team/dcplusplus/trunk
Your team Dcplusplus-team is subscribed to branch lp:dcplusplus.
To unsubscribe from this branch go to https://code.launchpad.net/~dcplusplus-team/dcplusplus/trunk/+edit-subscription
=== modified file 'dcpp/GetSet.h'
--- dcpp/GetSet.h 2011-12-27 20:47:59 +0000
+++ dcpp/GetSet.h 2012-01-01 18:19:59 +0000
@@ -32,14 +32,13 @@
* one setter function that binds to the rest and assigns a copy of the value passed as
parameter to the member variable. */
-#include <boost/mpl/if.hpp>
#include <type_traits>
#ifndef DCPLUSPLUS_SIMPLE_GETSET
#define GETSET(t, name, name2) \
private: t name; \
-public: boost::mpl::if_c<std::is_class<t>::value, const t&, t>::type get##name2() const { return name; } \
+public: std::conditional<std::is_class<t>::value, const t&, t>::type get##name2() const { return name; } \
\
template<typename GetSetT> typename std::enable_if<!std::is_class<GetSetT>::value, void>::type \
set##name2(GetSetT name) { this->name = name; } /* small type: simple setter that just copies */ \