Skip to content

Wrong class names in BinarySemaphore wrapper #12

@JanWendler

Description

@JanWendler

Summary

I think the copy constructor and the assignment operator of the "BinarySemaphore" class have the wrong class name, when using a C++ version before C++11. I have also noticed, that the code example for the class uses "Semaphore" as the type.

Current Code

#if __cplusplus < 201101L
    Semaphore(Semaphore const&);      ///< We are not copyable.
    void operator =(Semaphore const&);  ///< We are not assignable.
#else
    BinarySemaphore(BinarySemaphore const&) = delete;      ///< We are not copyable.
    void operator =(BinarySemaphore const&) = delete;  ///< We are not assignable.
#endif // __cplusplus
/**
 * @brief Binary Semaphore Wrapper.
 *
 * Example Usage:
 * @code
 * Semaphore sema("MySema");
 *
 * // In some task
 * sema.give();
 *

Expected Code

#if __cplusplus < 201101L
    BinarySemaphore(BinarySemaphore const&);      ///< We are not copyable.
    void operator =(BinarySemaphore const&);  ///< We are not assignable.
#else
    BinarySemaphore(BinarySemaphore const&) = delete;      ///< We are not copyable.
    void operator =(BinarySemaphore const&) = delete;  ///< We are not assignable.
#endif // __cplusplus
/**
 * @brief Binary Semaphore Wrapper.
 *
 * Example Usage:
 * @code
 * BinarySemaphore sema("MySema");
 *
 * // In some task
 * sema.give();
 *

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions