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 #1

Updated by Junxiao Shi over 6 years ago

  • Status changed from New to Code review
  • Assignee set to Junxiao Shi
  • % Done changed from 0 to 100
Actions #2

Updated by Junxiao Shi over 6 years ago

  • Status changed from Code review to Closed
Actions

Also available in: Atom PDF