1

Please see the given example:

#ifndef OUTER_H
#define OUTER_H

class Outer
{
    class Inner
    {
    public:
        Innner();
    };

};

#endif

My question is: Do I need to create a header guard somewhere for my Inner class, or just one for the whole file?

Anderson
  • 25
  • 6

1 Answers1

3

As your main header guard contains everything, and I'm assuming that is a .h file, which means it contains only declarations (or at least it should), then everything that is within the guard is guarded. So in short, no, you don't need an extra guard.

J3STER
  • 1,027
  • 2
  • 11
  • 28