Date: Thu, 16 Apr 2026 21:41:12 +0200
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
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
Received on 2026-04-16 19:41:37
