- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
i was under the impression that the keyword "override" was supported by version 13.0 of the intel compiler, but I am getting the following error (my code is copied directly from cppreference: http://en.cppreference.com/w/cpp/language/override). Thanks very much for the help.
struct A
{
virtual void foo();
void bar();
};
struct B : A
{
void foo() const override; // Error: Has a different signature from A::foo
void foo() override; // OK: base class contains a virtual function with the same signature
void bar() override; // Error: B::bar doesn't override because A::bar is not virtual
};
int main()
{
return 0;
}
icpc -std=c++11 Main2.C -o test
Main2.C(9): error: expected a ";"
void foo() const override; // Error: Has a different signature from A::foo
^
Main2.C(10): error: expected a ";"
void foo() override; // OK: base class contains a virtual function with the same signature
^
Main2.C(11): error: expected a ";"
void bar() override; // Error: B::bar doesn't override because A::bar is not virtual
^
compilation aborted for Main2.C (code 2)
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page