Stan Math Library  2.6.3
probability, sampling & optimization
 All Classes Namespaces Files Functions Variables Typedefs Enumerator Friends Macros
invalid_argument.hpp
Go to the documentation of this file.
1 #ifndef STAN_MATH_PRIM_SCAL_ERR_INVALID_ARGUMENT_HPP
2 #define STAN_MATH_PRIM_SCAL_ERR_INVALID_ARGUMENT_HPP
3 
4 #include <typeinfo>
5 #include <string>
6 #include <sstream>
7 #include <stdexcept>
8 
9 namespace stan {
10  namespace math {
11 
30  template <typename T>
31  inline void invalid_argument(const char* function,
32  const char* name,
33  const T& y,
34  const char* msg1,
35  const char* msg2) {
36  std::ostringstream message;
37 
38  message << function << ": "
39  << name << " "
40  << msg1
41  << y
42  << msg2;
43 
44  throw std::invalid_argument(message.str());
45  }
46 
65  template <typename T>
66  inline void invalid_argument(const char* function,
67  const char* name,
68  const T& y,
69  const char* msg1) {
70  invalid_argument(function, name, y, msg1, "");
71  }
72 
73  }
74 }
75 #endif
void invalid_argument(const char *function, const char *name, const T &y, const char *msg1)
Throw an invalid_argument exception with a consistently formatted message.
void invalid_argument(const char *function, const char *name, const T &y, const char *msg1, const char *msg2)
Throw an invalid_argument exception with a consistently formatted message.

     [ Stan Home Page ] © 2011–2015, Stan Development Team.