Arcane  4.1.12.0
User documentation
Loading...
Searching...
No Matches
FloatingPointExceptionSentry.h
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/* FloatingPointExceptionSentry.h (C) 2000-2023 */
9/* */
10/* Temporary activation/deactivation of floating-point exceptions */
11/*---------------------------------------------------------------------------*/
12#ifndef ARCANE_UTILS_FLOATINGPOINTEXCEPTIONSENTRY_H
13#define ARCANE_UTILS_FLOATINGPOINTEXCEPTIONSENTRY_H
14/*---------------------------------------------------------------------------*/
15/*---------------------------------------------------------------------------*/
16
18
19/*---------------------------------------------------------------------------*/
20/*---------------------------------------------------------------------------*/
21
22namespace Arcane
23{
24
25/*---------------------------------------------------------------------------*/
26/*---------------------------------------------------------------------------*/
27
28/*!
29 * \brief Class allowing temporary activation/deactivation of exceptions
30 * of the processor.
31 *
32 * This class allows temporary modification of the state of the exceptions
33 * floating-point. The previous state is reactivated when the destructor is called.
34 */
35class ARCANE_UTILS_EXPORT FloatingPointExceptionSentry
36{
37 public:
38
39 explicit FloatingPointExceptionSentry(bool want_active);
40 ~FloatingPointExceptionSentry();
41
42 private:
43
44 bool m_want_active = false;
45 bool m_is_active = false;
46};
47
48/*---------------------------------------------------------------------------*/
49/*---------------------------------------------------------------------------*/
50
51} // namespace Arcane
52
53/*---------------------------------------------------------------------------*/
54/*---------------------------------------------------------------------------*/
55
56#endif
Arcane configuration file.
-- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature --