mirror of
https://github.com/boostorg/ublas.git
synced 2026-02-21 15:32:12 +00:00
Minor rework of noncopyable and nonassignable
svn path=/trunk/boost/boost/numeric/ublas/; revision=24602
This commit is contained in:
@@ -23,11 +23,9 @@
|
||||
#include <boost/config.hpp>
|
||||
#include <boost/static_assert.hpp>
|
||||
#include <boost/limits.hpp>
|
||||
#include <boost/utility.hpp>
|
||||
#include <boost/noncopyable.hpp>
|
||||
#include <boost/mpl/if.hpp>
|
||||
#include <boost/mpl/and.hpp>
|
||||
#include <boost/mpl/vector.hpp>
|
||||
#include <boost/mpl/find.hpp>
|
||||
#include <boost/type_traits/is_same.hpp>
|
||||
#include <boost/type_traits/is_const.hpp>
|
||||
#include <boost/type_traits/remove_reference.hpp>
|
||||
|
||||
@@ -17,21 +17,24 @@
|
||||
#ifndef BOOST_UBLAS_FWD_H
|
||||
#define BOOST_UBLAS_FWD_H
|
||||
|
||||
namespace boost {
|
||||
|
||||
namespace boost { namespace numeric { namespace ublas {
|
||||
|
||||
// Borrowed from Dave Abraham's noncopyable.
|
||||
// I believe this should be part of utility.hpp one day...
|
||||
class nonassignable {
|
||||
protected:
|
||||
nonassignable(){}
|
||||
~nonassignable(){}
|
||||
private: // emphasize the following members are private
|
||||
const nonassignable& operator=( const nonassignable& );
|
||||
}; // nonassignable
|
||||
namespace nonassignable_ // protection from unintended ADL
|
||||
{
|
||||
class nonassignable {
|
||||
protected:
|
||||
nonassignable(){}
|
||||
~nonassignable(){}
|
||||
private: // emphasize the following members are private
|
||||
const nonassignable& operator=( const nonassignable& );
|
||||
}; // nonassignable
|
||||
}
|
||||
|
||||
typedef nonassignable_::nonassignable nonassignable;
|
||||
|
||||
}
|
||||
|
||||
namespace boost { namespace numeric { namespace ublas {
|
||||
|
||||
struct concrete_tag {};
|
||||
struct abstract_tag {};
|
||||
|
||||
@@ -49,7 +49,7 @@ namespace boost { namespace numeric { namespace ublas {
|
||||
*/
|
||||
template<class C>
|
||||
class container_const_reference:
|
||||
private boost::nonassignable {
|
||||
private nonassignable {
|
||||
public:
|
||||
typedef C container_type;
|
||||
|
||||
@@ -88,7 +88,7 @@ namespace boost { namespace numeric { namespace ublas {
|
||||
*/
|
||||
template<class C>
|
||||
class container_reference:
|
||||
private boost::nonassignable {
|
||||
private nonassignable {
|
||||
public:
|
||||
typedef C container_type;
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@ namespace boost { namespace numeric { namespace ublas {
|
||||
// Base class for the Barton Nackman trick
|
||||
template<class E>
|
||||
struct matrix_expression:
|
||||
private boost::nonassignable {
|
||||
private nonassignable {
|
||||
BOOST_STATIC_CONSTANT (int, complexity = 0);
|
||||
typedef E expression_type;
|
||||
typedef matrix_tag type_category;
|
||||
|
||||
@@ -14,16 +14,16 @@ namespace boost { namespace numeric { namespace ublas {
|
||||
// Provides temporary free assigment when LHS has no alias on RHS
|
||||
template<class C>
|
||||
class noalias_proxy:
|
||||
private boost::nonassignable {
|
||||
private nonassignable {
|
||||
public:
|
||||
typedef typename C::closure_type closure_type;
|
||||
|
||||
BOOST_UBLAS_INLINE
|
||||
noalias_proxy (C& lval):
|
||||
boost::nonassignable (), lval_ (lval) {}
|
||||
nonassignable (), lval_ (lval) {}
|
||||
BOOST_UBLAS_INLINE
|
||||
noalias_proxy (const noalias_proxy& p):
|
||||
boost::nonassignable (), lval_ (p.lval_) {}
|
||||
nonassignable (), lval_ (p.lval_) {}
|
||||
|
||||
template <class E>
|
||||
BOOST_UBLAS_INLINE
|
||||
|
||||
@@ -29,7 +29,7 @@ namespace boost { namespace numeric { namespace ublas {
|
||||
|
||||
template<class T>
|
||||
struct scalar_expression:
|
||||
private boost::nonassignable {
|
||||
private nonassignable {
|
||||
typedef T value_type;
|
||||
};
|
||||
|
||||
@@ -92,7 +92,7 @@ namespace boost { namespace numeric { namespace ublas {
|
||||
// Base class for the Barton Nackman trick
|
||||
template<class E>
|
||||
struct vector_expression:
|
||||
private boost::nonassignable {
|
||||
private nonassignable {
|
||||
BOOST_STATIC_CONSTANT (int, complexity = 0);
|
||||
typedef E expression_type;
|
||||
typedef vector_tag type_category;
|
||||
|
||||
Reference in New Issue
Block a user