Calculator  Step 4
Public Member Functions | Private Member Functions | List of all members
function_error Class Reference

#include <calc_error.hpp>

Inheritance diagram for function_error:
calc_error

Public Member Functions

 function_error (std::string const &name, std::size_t expected, std::size_t actual)
 
- Public Member Functions inherited from calc_error
 calc_error (std::string const &msg)
 

Private Member Functions

std::string msg (std::string const &name, std::size_t expected, std::size_t actual)
 

Detailed Description

Exception class for function call problems.

Definition at line 34 of file calc_error.hpp.

Constructor & Destructor Documentation

function_error::function_error ( std::string const &  name,
std::size_t  expected,
std::size_t  actual 
)
inline

Definition at line 37 of file calc_error.hpp.

References msg().

38  : calc_error{msg(name, expected, actual)}
39  {}
std::string msg(std::string const &name, std::size_t expected, std::size_t actual)
Definition: calc_error.cpp:5

Member Function Documentation

std::string function_error::msg ( std::string const &  name,
std::size_t  expected,
std::size_t  actual 
)
private

Definition at line 5 of file calc_error.cpp.

Referenced by function_error().

6 {
7  std::ostringstream stream{};
8  stream << "wrong number of arguments in call to " + name + "(), expected " << expected << ", got " << actual;
9  return stream.str();
10 }

The documentation for this class was generated from the following files: