Follow

does anyone actually use header guards anymore in personal c++ projects lol

@deadbeef Only to prevent errors about duplication of entities at either compile or link time.

@rmerriam " once" directive seems to be supported by most compilers nowadays. I've never had to use manual include guards, though again, none of the projects I've worked on are really that big.

@rmerriam Could be some edge cases where once doesn't work.

@deadbeef

I consider both techniques to be guards. Generally, I use the pragma.

@rmerriam True, although by "header/include guard" I meant the "old style" using , , etc. And yeah, pragma is definitely more convenient.

@deadbeef pragma once, but don’t think about it much CLion takes care of it

Sign in to participate in the conversation
Qoto Mastodon

QOTO: Question Others to Teach Ourselves
An inclusive, Academic Freedom, instance
All cultures welcome.
Hate speech and harassment strictly forbidden.