C++ Logo

std-proposals

Advanced search

Re: [std-proposals] requires for non template classes

From: Andre Kostur <andre_at_[hidden]>
Date: Thu, 16 Apr 2026 12:44:36 -0700
Perhaps if you had an example of what you’d like to do? If it’s
non-template code, then all of the types are known so there doesn’t seem to
be anything to constrain.

On Thu, Apr 16, 2026 at 12:41 PM Adrian via Std-Proposals <
std-proposals_at_[hidden]> wrote:

> Hello everyone,
>
>
> templates in c++ offer a great way to modularize your codebase without a
> sacrificing on compile time speed. My Proposal is relatively simple.
> Requires should also work on non template classes without the need to do an
> static assert. I think this would be more suiting in the context of modern
> c++, while providing consistent code style. I know right now that is also
> possible by using a placeholder template! But this a very ugly in my
> opinion, since a template always insinuates that something needs to be
> provided.
>
> Thank you everybody for reading my little proposal. Please correct me, if
> this was already discussed or not possible due to language limitation,
> etc... . I am relatively new to c++ and therefor still exploring the limits
> of the language.
>
>
> Best regards
>
> Adrian
>
>
> --
> Std-Proposals mailing list
> Std-Proposals_at_[hidden]
> https://lists.isocpp.org/mailman/listinfo.cgi/std-proposals
>

Received on 2026-04-16 19:44:50