Skip to content

Compilation Issue Due to Method Definitions in Both '.cpp' and '.hpp' Files in 'greg_weekday' Class #980

Open
@Vignesh-Murugappan

Description

@Vignesh-Murugappan

The methods in the "greg_weekday" class are defined in both the .cpp and .hpp files, which causes a compilation issue.

For example, the as_short_string method is defined in greg_weekday.cpp as follows:

//! Return a 3-digit English string of the day of the week (e.g., Sun)
const char* greg_weekday::as_short_string() const 
{
    return short_weekday_names[value_];
}

However, the same method is also defined in the .hpp file as:

//! Return a 3-digit English string of the day of the week (e.g., Sun)
const char* as_short_string() const
{
    static const char* const short_weekday_names[] 
        = {"Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"};

    return short_weekday_names[value_];
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions