|
Boost Users : |
From: Robert Dailey (rcdailey_at_[hidden])
Date: 2007-11-19 16:38:04
Hi,
Right now I'm trying to overload the [] twice, however after compilation is
done only one of the overloads will actually exist at runtime:
template< unsigned int t_number >
struct foo
{
t_type data[10];
t_type& operator[] ( unsigned int index ) { return data[index]; }
};
In the structure above, I have only shown 1 array index operator just as an
example. I want to define two overloads with the following conditions:
1) If t_number is equal to 1, enable_if will allow the first overload for
the array operator.
2) If t_number is greater than 1, enable_if will allow the second overload
for the array operator.
Is there some sort of is_less_than or is_equal objects in boost I can use
with enable_if for my operator overloads? Thanks.
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net