Skip to content

#pragma once instead of header guards #71

@wermos

Description

@wermos

Our project currently uses header guards. However, all the compilers we currently support (and wish to support) support the #pragma once directive and have done so for a long time.

The advantages of using #pragma once over traditional header guards are numerous:

  • It's more readable
  • It's faster to write
  • There is no risk of header guard collision (two headers accidentally picking the same guard)

For this reason, I propose moving the project to using #pragma once instead of clunky #ifndef header guards.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions