コード例 #1
0
ファイル: multiply.cpp プロジェクト: peelonet/laskin
  value value::multiply(const value& that) const
  {
    if (that.is(m_type))
    {
      switch (m_type)
      {
        case type::number:
          return multiply_number(*m_value_number, *that.m_value_number);

        case type::vector:
          return multiply_vector(*m_value_vector, *that.m_value_vector);

        default:
          break;
      }
    }

    throw error(
      error::type::type,
      U"Cannot multiply " +
      type_description(that.m_type) +
      U" with " +
      type_description(m_type)
    );
  }