On 04.08.2012 16:46, Steven Watanabe wrote:
AMDG
On 08/03/2012 02:32 PM, Sergey Mitsyn wrote:
Hello,
Just some questions:
1) Missing #include <cassert> in "boost\type_erasure\detail\storage.hpp"
This header doesn't use assert.
Sorry, my fault - being messing with headers a little.
2) Maybe i'm missing something, but it feels like the library doesn't support concept function arguments an return types that contain placeholder as a template parameter. Imagine a concept that returns "std::pair
", where TIterator is another any: template
struct foo_concept { typedef std::pair result_type; static result_type apply(C& c) { return std::make_pair(c.begin(),c.end()); } }; Probably the problem is with detail::rebind_placeholders_in_argument. The expected behavior is replacing 'TIterator' with something like 'std::_Vector_iterator' (or what it should be in specific case), just like mpl::lambda replaces its mpl::_N placeholders.
Also I cannot just replace std::pair with another any - I'm trying to match the preexisting concepts.
I've put an example into attachment.
The library can't handle this without special knowledge of std::pair. This would mean creating some kind of extension point, which I'm not willing to do at this point.
Why is that? AFAIK it's rather easy to determine class template and template arguments from its instantiation - by passing it to specialized class template. The "recursive" argument rebinding comes out naturally. Is there another problem?
The easiest way to handle this particular case is to use output parameters
template
struct foo_concept { static void apply(C&, TIterator&, TIterator&); };
Ok. Adapting to std::pair
In Christ, Steven Watanabe
-- ------------ Sergey Mitsyn.