bactria  0.0.1
The bactria library is a header-only C++14 library for profiling and tracing.
Activation.hpp
Go to the documentation of this file.
1 /* Copyright 2021 Jan Stephan
2  *
3  * Licensed under the EUPL, Version 1.2 or - as soon they will be approved by
4  * the European Commission - subsequent versions of the EUPL (the “Licence”).
5  * You may not use this work except in compliance with the Licence.
6  * You may obtain a copy of the Licence at:
7  *
8  * http://ec.europa.eu/idabc/eupl.html
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the Licence is distributed on an “AS IS” basis, WITHOUT
12  * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13  * Licence permissions and limitations under the Licence.
14  */
15 
24 #pragma once
25 
26 #include <cstdlib>
27 
28 namespace bactria
29 {
52  inline auto is_active() -> bool
53  {
54  static auto const active = (std::getenv("BACTRIA_DEACTIVATE") == nullptr);
55  return active;
56  }
57 
62  // clang-format off
317  // clang-format on
318 } // namespace bactria
bactria::is_active
auto is_active() -> bool
Checks whether the bactria library has been deactivated by the user.
Definition: Activation.hpp:52