Boost logo

Boost Users :

Subject: Re: [Boost-users] question about fusion concepts/documentation
From: Gordon Woodhull (gordon_at_[hidden])
Date: 2011-05-30 21:15:07


On May 30, 2011, at 8:00 PM, Matt Calabrese wrote:
> Can you give an example of what kind of interface requirements you'd have? I'm imagining that you mean some kind of required metafunctions that are associated with the types, in which case I'm pretty sure that all you'd need past what I currently have implemented are associated templates, but I want to make sure we really are on the same page.

I think so. Heterogeneous graph concepts are just like any heterogeneous container concepts. The only place where it might get weird is that you can have (if I'm using the terminology correctly) cycles of associated types. E.g. a graph has vertices, which connect to edges, which potentially have pointers back to the graph. But I don't see why this would be a problem, either defining a concept per type or one for all of the types.

On May 30, 2011, at 8:10 PM, Matt Calabrese wrote:
> Concepts, as they were proposed, could only appear at namespace scope, so you can't, for instance, have some kind of complex, metaprogrammed concept that is generated based on a compile-time graph from within a template. That would be very powerful, indeed, but is not possible.

Thank goodness. If I started thinking about that, my brain would explode.

> You also can't pass concepts themselves around as template parameters or alias them within types, so there technically isn't a way to store a concept as data in a compile-time graph.

Hmmmm. Is there even a way of mapping from a type to a concept, i.e. having tags that identify concepts?

Or is the mapping strictly the other way around by design?

> However, as you have said, since I am emulating concepts with templates, I could branch off from what concepts were and actually support such features, but I'd rather avoid that and stick as close to what would have been standard as I can, at least until I implement everything that would have been standard as well as I can. Perhaps once I finish that, I will consider experimenting with further functionality, but that is a ways off.

Well, I wouldn't want you to muddy your library with non-standard features. I was just figuring that as a (mis-)user I could pass the Generic concepts around since they're actually templates.

But it kind of sounds like I'm trying to use concepts wrong. If I can't describe an abstract pattern in metadata, perhaps it is enough just to validate a concrete pattern using concepts. I was hoping to have a way to say "this algo requires a system of objects which model all of these concepts." Maybe I don't need to put the concepts in a graph in order to do that.

I'll have to think about it more. Metagraphs are also a ways off.

Thanks,
Gordon


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