Здравствуйте, psi_fan, Вы писали:
_>Что же касается индексирования то хотелось бы что-то вроде:
_>template <class U> U const & operator[]( int index )
_>{
_>//returns reference to the index-th inserted element, casted to its native type.
_>}
так нельзя. рантйм не может влиять на компайл-тайм.
Chez, ICQ#161095094 
Posted via:RSDN@Home;version:1.1.3;muzikstamp:Orplid — Inneres Heer
psi_fan wrote:
> Что же касается индексирования то хотелось бы что-то вроде:
> template <class U> U const & operator[]( int index )
> {
> //returns reference to the index-th inserted element, casted to its native type.
> }
template<class T>
struct index
{
index(size_t n) : n(n) {}
size_t n;
};
template<class T>
T const& operator[](index<T> i);
xxx[index<whatever>(1)];
--
Maxim YegorushkinPosted via RSDN NNTP Server 1.9