Boost logo

Boost :

From: Joaquin M López Muñoz (joaquinlopezmunoz_at_[hidden])
Date: 2021-02-24 18:34:18


El 23/02/2021 a las 16:03, Krzysztof Jusiak via Boost escribió:
>> This is clearly stupendously clever.
>>
>> What I don't understand is what specific thing is linking the bound
>> Allocator type in the injector to the specialisation point in the app's
>> constructor. Is it this:
>> template<class TAllocator = class Allocator>
>> ?
>>
>> This is going to need to be meticulously documented and spelled out in
>> small words for people like me who obviously live in your intellectual
>> shadow.
>>
>>
> Yeah, templates are bound by default types names (notice that it also allow
> concepts - AllocatorConcept = class Allocator) whilst constructor
> parameters are deduced.
> Firstly, types are rebound and then proper constructor parameters are
> being injected. If anything is missing in the wiring compilation error will
> be triggered.

Does the library also support binding to class *template* types? Sort of:

auto injector = di::make_injector(
di::bind_class_template<std::allocator>.to<my_allocator>()
);

Joaquín M López Muñoz


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk