OmniSciDB  04ee39c94c
Parser::DefaultValidate< IntLiteral > Struct Template Reference

#include <ParserNode.h>

Public Member Functions

template<typename T >
decltype(auto) operator() (T t)
 

Detailed Description

template<>
struct Parser::DefaultValidate< IntLiteral >

Definition at line 1926 of file ParserNode.h.

Member Function Documentation

◆ operator()()

template<typename T >
decltype(auto) Parser::DefaultValidate< IntLiteral >::operator() ( t)
inline

Definition at line 1928 of file ParserNode.h.

1928  {
1929  const std::string property_name(boost::to_upper_copy<std::string>(*t->get_name()));
1930  if (!dynamic_cast<const IntLiteral*>(t->get_value())) {
1931  throw std::runtime_error(property_name + " must be an integer literal.");
1932  }
1933  const auto val = static_cast<const IntLiteral*>(t->get_value())->get_intval();
1934  if (val <= 0) {
1935  throw std::runtime_error(property_name + " must be a positive number.");
1936  }
1937  return val;
1938  }

The documentation for this struct was generated from the following file: