Arcane  4.1.12.0
User documentation
Loading...
Searching...
No Matches
IndexOutOfRangeException.cc
1// -*- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature -*-
2//-----------------------------------------------------------------------------
3// Copyright 2000-2026 CEA (www.cea.fr) IFPEN (www.ifpenergiesnouvelles.com)
4// See the top-level COPYRIGHT file for details.
5// SPDX-License-Identifier: Apache-2.0
6//-----------------------------------------------------------------------------
7/*---------------------------------------------------------------------------*/
8/* IndexOutOfRangeException.cc (C) 2000-2025 */
9/* */
10/* Exception when an array index is invalid. */
11/*---------------------------------------------------------------------------*/
12/*---------------------------------------------------------------------------*/
13
14#include "arccore/base/IndexOutOfRangeException.h"
15
16#include <iostream>
17
18/*---------------------------------------------------------------------------*/
19/*---------------------------------------------------------------------------*/
20
21namespace Arcane
22{
23
24/*---------------------------------------------------------------------------*/
25/*---------------------------------------------------------------------------*/
26
27IndexOutOfRangeException::
28IndexOutOfRangeException(const TraceInfo& where, const String& message,
29 Int64 index, Int64 min_value_inclusive,
30 Int64 max_value_exclusive)
31: Exception("IndexOutOfRange", where, message)
32, m_index(index)
33, m_min_value_inclusive(min_value_inclusive)
34, m_max_value_exclusive(max_value_exclusive)
35{
36}
37
38/*---------------------------------------------------------------------------*/
39/*---------------------------------------------------------------------------*/
40
41void IndexOutOfRangeException::
42explain(std::ostream& m) const
43{
44 m << "Index '" << m_index << "' out of bounds ("
45 << m_min_value_inclusive << " <= "
46 << m_index << " < "
47 << m_max_value_exclusive << ").\n";
48}
49
50/*---------------------------------------------------------------------------*/
51/*---------------------------------------------------------------------------*/
52
53} // namespace Arcane
54
55/*---------------------------------------------------------------------------*/
56/*---------------------------------------------------------------------------*/
-- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature --
std::int64_t Int64
Signed integer type of 64 bits.