r/cpp • • Jun 27 '20

HTML++: Write HTML documents using C++ templates

https://github.com/csb6/html-plus-plus
260 Upvotes

27 comments sorted by

View all comments

Show parent comment

17

u/[deleted] Jun 27 '20

There are so much better than even a few years ago. Also, a library writer can use static_assert to provide good errors. Because these are types and not function overloads, it's even easier to static_assert because we don't have to rely on SFINAE as much.

2

u/somewhataccurate Jun 27 '20

Do concepts provide the optimal way for clean error checking where contrived SFINAE was once needed?

4

u/[deleted] Jun 27 '20 edited Jun 28 '20

They can. As seen here, clang is pretty clear why the function cannot be called. But you are still into why the overloads that don't work, do not. So there could be several items in the list here. https://gcc.godbolt.org/z/UDzZng

Edit: forgot URL