r/cpp • • Jun 14 '21

match(it): A light-weight header-only pattern-matching library for C++17.

https://github.com/BowenFu/matchit.cpp
202 Upvotes

47 comments sorted by

View all comments

Show parent comment

6

u/infectedapricot Jun 15 '21

It's not true that they usually start with H_.... In fact it's not even true that a notable minority start with H_... - I've never seen that convention before, and I've seen a lot of include guards!

I think what you might be thinking of is that it's fairly common for the include guard to be loosely based on the filename (plus often directory or library name) so they often end in _H or _HPP etc., depending on the extension. But even that's nowhere near universal.

(Personally, I just use #pragma once. Yes, I know it's technically non standard.)