Skip to content
This repository was archived by the owner on Sep 22, 2025. It is now read-only.
This repository was archived by the owner on Sep 22, 2025. It is now read-only.

bug: missing include guard in Candapter.h #1

Description

@t-bre

Description

Candapter.h needs an include guard to avoid the problem of double inclusion (as will any other header files).

Ways to do this:

  1. #define method:

    #ifndef _HEADER_NAME_H
    #define _HEADER_NAME_H
    
    // header code
    
    #endif

    There are various conventions for how to name the #define, but generally it ends with _H and has one or two underscores at the start.

  2. #pragma method:

    #pragma once
    
    // header code

    I find this method cleaner, though it isn't part of the C++ standard so it could make it less portable. That said, I've never used a compiler that doesn't support it.

Expected Behaviour

Include guard exists.

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

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions