C++ Logo

SG7

Advanced search

Subject: Re: P2320: "The Syntax of Static Reflection" feedback request
From: Ville Voutilainen (ville.voutilainen_at_[hidden])
Date: 2021-02-21 10:46:06


On Sun, 21 Feb 2021 at 16:45, David Rector via SG7 <sg7_at_[hidden]> wrote:
> But to be clear, the Sum<T, U> example, and others of that level of complexity, *definitely need to be supported*. If Andrew et al disagree, I think we deserve an explicit statement to that effect. There is a lot of functionality at stake here.

Such things certainly should be supported. It's just another variant
of a generic Mediator that invokes multiple
Observers, and summing is just one of many things that one might want
to do with such a thing, others
include, for example, collecting the results in a tuple, and
collecting the results into a vector. The generic Mediator
has the same functions its Observers have, and it just injects those
functions into its own interface by reflecting
the interface(s) of the Observer(s). We write these things fairly
often, and reflection+injection makes it significantly
less boilerplatey and more generic. And *using* such a generic
Mediator makes it very easy to write such combinations
without the status quo of excessive boiler-plate programming.


SG7 list run by sg7-owner@lists.isocpp.org

Older Archives on Google Groups