Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r65746 - sandbox/opaque/boost/opaque/meta_mixin
From: vicente.botet_at_[hidden]
Date: 2010-10-04 07:28:10


Author: viboes
Date: 2010-10-04 07:28:09 EDT (Mon, 04 Oct 2010)
New Revision: 65746
URL: http://svn.boost.org/trac/boost/changeset/65746

Log:
Opaque:
* Renaming
* Added logical and/or

Text files modified:
   sandbox/opaque/boost/opaque/meta_mixin/operators.hpp | 76 +++++++++++++++++++++++++++------------
   1 files changed, 53 insertions(+), 23 deletions(-)

Modified: sandbox/opaque/boost/opaque/meta_mixin/operators.hpp
==============================================================================
--- sandbox/opaque/boost/opaque/meta_mixin/operators.hpp (original)
+++ sandbox/opaque/boost/opaque/meta_mixin/operators.hpp 2010-10-04 07:28:09 EDT (Mon, 04 Oct 2010)
@@ -20,30 +20,30 @@
 
 //////////////////////////////////////////////////////////////////////////////
 
-#define BOOST_OPAQUE_HIDING_COPY(T) \
+#define BOOST_OPAQUE_HIDING_COPY_CONSTRUCTOR(T) \
         private: \
             T( const T& );
 
- struct hiding_copy {
+ struct hiding_copy_constructor {
         template <typename Final, typename Base>
         struct type : Base {
- BOOST_OPAQUE_HIDING_COPY(type)
+ BOOST_OPAQUE_HIDING_COPY_CONSTRUCTOR(type)
         };
     };
 
 //////////////////////////////////////////////////////////////////////////////
 
-#define BOOST_OPAQUE_HIDING_ASSIGN(T) \
+#define BOOST_OPAQUE_HIDING_ASSIGNEMENT(T) \
         private: \
             T& operator=(T const&);
 
- struct hiding_assign {
+ struct hiding_assignment {
         template <typename Final, typename Base>
         struct type : Base {
- BOOST_OPAQUE_HIDING_ASSIGN(type)
+ BOOST_OPAQUE_HIDING_ASSIGNEMENT(type)
         };
     };
-
+
 //////////////////////////////////////////////////////////////////////////////
 
 #define BOOST_OPAQUE_USING_CONVERSION(Final,UT) \
@@ -361,6 +361,36 @@
     };
 
 //////////////////////////////////////////////////////////////////////////////
+#define BOOST_OPAQUE_USING_LOGICAL_AND(Final,Bool) \
+ public :\
+ Bool operator&&(const Final& rhs) const { \
+ return Bool(Final::underlying(this) && rhs.underlying());\
+ }
+
+ template <typename Bool=bool>
+ struct using_logical_and {
+ template <typename Final, typename Base>
+ struct type: Base {
+ BOOST_OPAQUE_USING_LOGICAL_AND(Final,Bool)
+ };
+ };
+
+//////////////////////////////////////////////////////////////////////////////
+#define BOOST_OPAQUE_USING_LOGICAL_OR(Final,Bool) \
+ public :\
+ Bool operator||(const Final& rhs) const { \
+ return Bool(Final::underlying(this) || rhs.underlying());\
+ }
+
+ template <typename Bool=bool>
+ struct using_logical_or {
+ template <typename Final, typename Base>
+ struct type: Base {
+ BOOST_OPAQUE_USING_LOGICAL_OR(Final,Bool)
+ };
+ };
+
+//////////////////////////////////////////////////////////////////////////////
 
 #define BOOST_OPAQUE_USING_UNARY_PLUS(Final) \
     public :\
@@ -408,37 +438,37 @@
 //////////////////////////////////////////////////////////////////////////////
 
 //~ template <typename Final, typename Base>
-//~ struct address_of : Base {
-//~ Final* operator&() {
-//~ return this;
-//~ }
+//~ struct using_address_of : Base {
+//~ Final* operator&() {
+//~ return this;
+//~ }
 //~ };
 
 //////////////////////////////////////////////////////////////////////////////
 
 //~ template <typename Final, typename Derreference=typename reference<Final::underlying_type>::type, typename Base>
-//~ struct derreference : Base {
-//~ Derreference operator*() {
-//~ return *(x.underlying());
-//~ }
+//~ struct using_derreference : Base {
+//~ Derreference operator*() {
+//~ return *(x.underlying());
+//~ }
 //~ };
 
 //////////////////////////////////////////////////////////////////////////////
 
 //~ template <typename Final, typename Pointer=typename pointer<Final::underlying_type>::type, typename Base>
-//~ struct member_access : Base {
-//~ Pointer operator->() {
-//~ return x.underlying().operator->();
-//~ }
+//~ struct using_member_access : Base {
+//~ Pointer operator->() {
+//~ return x.underlying().operator->();
+//~ }
 //~ };
 
 //////////////////////////////////////////////////////////////////////////////
 
 //~ template <typename Final, class I, class R, typename Base>
-//~ struct subscript : Base {
-//~ R operator[](I n) {
-//~ return x.underlying()[i];
-//~ }
+//~ struct using_subscript : Base {
+//~ R operator[](I n) {
+//~ return x.underlying()[i];
+//~ }
 //~ };
 
 // Increment and decrement


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