Skip to content

#pragma once instead of header guards #71

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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