Boost logo

Boost Users :

Subject: Re: [Boost-users] [array][bind] Binding boost array to a boost function
From: michi7x7 (mailing-lists_at_[hidden])
Date: 2010-10-11 15:55:52


  Am 11.10.2010 21:46, schrieb Ryan McConnehey:
> michi7x7 wrote:
>> Am 11.10.2010 01:59, schrieb Ryan McConnehey:
>> Hi,
>>
>> yes it is, but you need to pass the template-parameters:
>>
>> Sorter<int, 8> shell(boost::bind(quicksort<int, 8>, _1));
>>
>> or simply
>>
>> Sorter<int, 8> shell(quicksort<int,8>);
>>
>> Regards,
>>
>> michi7x7
> By binding to the exact template parameters it makes the Sorter not as
> flexible as I'm hoping. If I have two boost arrays defined like so.
>
> boost::array<int, 100> base10power2;
> boost::array<int, 1000> base10power3;
>
> Is there a way to just bind the array type but not the size. This
> would let me call the same method with different size arrays.
>
Hi,

unfortunately not with boost::array, because the array-size is static.
Use std::vector instead ;)

Regards,

michi7x7


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