#include <boost/ref.hpp>
#include <boost/array.hpp>
#include <boost/utility.hpp>
using namespace std;
template<class T>
struct
test
{
test() :
ptr(new T())
{}
~test()
{
delete ptr;
}
boost::reference_wrapper<T> operator*()
{
return
boost::ref(*ptr);
}
T*
ptr;
};
template<class T, int
N>
class array : public
boost::array<T,N>
, private
boost::noncopyable
{};
int
main(int argc, char* argv[])
{
test< array<int,10> > t;
int size = (static_cast<array<int,10>&>(*t)).size();
}
int size = (*t).size();
operator ->() would work just fine, but I need to support both.
Thanks for help,
Ovanes Markarian