Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
Vignesh-Murugappan opened this issue Nov 13, 2024 · 0 comments

Comments

@Vignesh-Murugappan
Copy link

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_];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant