Boost logo

Boost Users :

From: vlad (gvlad_at_[hidden])
Date: 2006-05-02 01:25:50

You can pass constant to template parameter. But you cannot pass constant
reference. Look:


const int var=1;

nth_index_iterator<var>::type; //ok


const int& var2=var;

nth_index_iterator<var2>::type; //error



From: boost-users-bounces_at_[hidden]
[mailto:boost-users-bounces_at_[hidden]] On Behalf Of chun ping wang
Sent: Tuesday, May 02, 2006 1:54 PM
To: boost-users_at_[hidden]
Subject: [Boost-users] passing variable into template parameters.


Its more of a c++ question but i wonder how would I pass constant variables
into template parameters such as nth_index_iterator.
Example: void func(const int& var)

Is this possible whats the work around this limitation?

Boost-users list run by williamkempf at, kalb at, bjorn.karlsson at, gregod at, wekempf at