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

bad default constructor #329

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 16 additions & 3 deletions gloo/common/error.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,11 @@ const std::chrono::milliseconds kNoTimeout = std::chrono::milliseconds::zero();

// A base class for all gloo runtime errors
struct Exception : public std::runtime_error {
Exception() = default;
/*
default constructor of 'Exception' is implicitly deleted because
base class 'std::runtime_error' has no default constructor
*/
// Exception() = default;
explicit Exception(const std::string& msg) : std::runtime_error(msg) {}
};

Expand All @@ -32,7 +36,12 @@ struct Exception : public std::runtime_error {

// Thrown for invalid operations on gloo APIs
struct InvalidOperationException : public ::gloo::Exception {
InvalidOperationException() = default;
/*
note: default constructor of 'InvalidOperationException' is implicitly
deleted
because base class '::gloo::Exception' has a deleted default constructor
*/
// InvalidOperationException() = default;
explicit InvalidOperationException(const std::string& msg)
: ::gloo::Exception(msg) {}
};
Expand All @@ -43,7 +52,11 @@ struct InvalidOperationException : public ::gloo::Exception {

// Thrown for unrecoverable IO errors
struct IoException : public ::gloo::Exception {
IoException() = default;
/*
default constructor of 'IoException' is implicitly deleted because
base class '::gloo::Exception' has a deleted default constructor
*/
// IoException() = default;
explicit IoException(const std::string& msg) : ::gloo::Exception(msg) {}
};

Expand Down