Program Listing for File common.h

Return to documentation for file (arbitrary/common.h)

#pragma once

#if !defined(NAMESPACE_BEGIN) || defined(DOXYGEN_DOCUMENTATION_BUILD)

    #define NAMESPACE_BEGIN(name) namespace name {
#endif
#if !defined(NAMESPACE_END) || defined(DOXYGEN_DOCUMENTATION_BUILD)

    #define NAMESPACE_END(name) }
#endif

enum UnscopedEnum {
    NO,
    YES
};

namespace external {
    static constexpr unsigned int MAX_DEPTH = 12;
}

struct params {
    params() : x(0.0f), y(0.0f), z(0.0f) {}

    params(float _x, float _y, float _z) : x(_x), y(_y), z(_z) {}

    union U {
        int32_t first_view;
        float second_view;
    };

    float x;
    float y;
    float z;
};

static constexpr float common_float_variable = 12.21f;

typedef bool super_bool;

union SupremeUnion {
    int32_t n;
    uint16_t s[2];
    uint8_t c;
};

namespace arbitrary {
    union NamespacedUnion {
        int32_t n;
        uint16_t s[2];
        uint8_t c;
    };

    struct zed_struct {
        zed_struct(int _z) : z(_z) {}

        int z;
    };

    namespace nested {
        union NestedNamespacedUnion {
            int32_t n;
            uint16_t s[2];
            uint8_t c;
        };
    }

    namespace second_nested {
        static constexpr double SN = 99.99;

        typedef void death_star;

        class NestingFirstLastChild {
            NestingFirstLastChild() {}

            ~NestingFirstLastChild() {}
        };

        class NestingLastChild {
            NestingLastChild() {}

            ~NestingLastChild() {}
        };
    }

    bool arbitraryFunction() {
        return false;
    }

    struct arbitrary_struct {
        int meh = 11;
        arbitrary_struct(int m) : meh(m) {}
    };
}

namespace first {
    namespace second {
        namespace third {
            struct only_namespace_testing {
                only_namespace_testing(double _d) : d(_d) {}

                double d;
            };

            namespace fourth {
                namespace fifth {
                    struct deeper_namespace_testing {
                        deeper_namespace_testing(double _d) : d(_d) {}

                        double d;

                        struct nested_struct {
                            nested_struct(float _f) : f(_f) {}

                            float f;
                        };
                    };
                }
            }
        }
    }
}

static void someCommonFunction(super_bool anything) {
    if(anything)
        return;
}