Project

General

Profile

Actions

Feature #4681

closed

code-style 2.24: update example with using base class constructor

Added by Junxiao Shi over 6 years ago. Updated over 6 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Docs
Target version:
Start date:
Due date:
% Done:

100%

Estimated time:
1.50 h

Description

rule 2.24 currently gives the following example:

#include <stdexcept>

class Foo
{
  class Error : public std::runtime_error
  {
  public:
    explicit
    Error(const std::string& what)
      : std::runtime_error(what)
    {
    }
  };
};

Since C++14, this can be simplified as:

#include <stdexcept>

class Foo
{
  class Error : public std::runtime_error
  {
  public:
    using std::runtime_error::runtime_error;
  };
};
Actions

Also available in: Atom PDF