Skip to content
Snippets Groups Projects
Commit 97690680 authored by Sam Jenkins's avatar Sam Jenkins
Browse files

Re #0 Updated the Empty values to be constexpr

parent fc1af4d9
No related branches found
No related tags found
No related merge requests found
...@@ -25,7 +25,6 @@ set ( SRC_FILES ...@@ -25,7 +25,6 @@ set ( SRC_FILES
src/DirectoryValidator.cpp src/DirectoryValidator.cpp
src/DiskBuffer.cpp src/DiskBuffer.cpp
src/DllOpen.cpp src/DllOpen.cpp
src/EmptyValues.cpp
src/EnabledWhenProperty.cpp src/EnabledWhenProperty.cpp
src/EnvironmentHistory.cpp src/EnvironmentHistory.cpp
src/EqualBinsChecker.cpp src/EqualBinsChecker.cpp
......
...@@ -15,19 +15,35 @@ ...@@ -15,19 +15,35 @@
#include "MantidKernel/DllConfig.h" #include "MantidKernel/DllConfig.h"
#include "MantidKernel/System.h" #include "MantidKernel/System.h"
#include <cfloat>
#include <climits>
namespace Mantid { namespace Mantid {
/// Returns what we consider an "empty" integer /**
DLLExport int EMPTY_INT(); * Returns what we consider an "empty" integer within a property
* @returns An flag value
*/
constexpr int EMPTY_INT() { return INT_MAX; }
/**
* Returns what we consider an "empty" long within a property
* @returns An flag value
*/
constexpr long EMPTY_LONG() { return LONG_MAX; }
/// Returns what we consider an "empty" long /**
DLLExport long EMPTY_LONG(); * Returns what we consider an "empty" int64_t within a property
* @returns An flag value
*/
constexpr int64_t EMPTY_INT64() { return INT64_MAX; }
/// Returns what we consider an "empty" int64_t /**
DLLExport int64_t EMPTY_INT64(); * Returns what we consider an "empty" double within a property
* @returns An flag value
*/
constexpr double EMPTY_DBL() { return DBL_MAX / 2; }
/// Return what we consider to be an empty double
DLLExport double EMPTY_DBL();
} // namespace Mantid } // namespace Mantid
#endif // MANTID_KERNEL_EMPTYVALUES_H_ #endif // MANTID_KERNEL_EMPTYVALUES_H_
// Mantid Repository : https://github.com/mantidproject/mantid
//
// Copyright &copy; 2018 ISIS Rutherford Appleton Laboratory UKRI,
// NScD Oak Ridge National Laboratory, European Spallation Source
// & Institut Laue - Langevin
// SPDX - License - Identifier: GPL - 3.0 +
//------------------------------------------------------------------------------
// Includes
//------------------------------------------------------------------------------
#include "MantidKernel/EmptyValues.h"
#include <cfloat>
#include <climits>
namespace Mantid {
/**
* Returns what we consider an "empty" integer within a property
* @returns An flag value
*/
int EMPTY_INT() { return INT_MAX; }
/**
* Returns what we consider an "empty" long within a property
* @returns An flag value
*/
long EMPTY_LONG() { return LONG_MAX; }
/**
* Returns what we consider an "empty" int64_t within a property
* @returns An flag value
*/
int64_t EMPTY_INT64() { return INT64_MAX; }
/**
* Returns what we consider an "empty" double within a property
* @returns An flag value
*/
double EMPTY_DBL() { return DBL_MAX / 2; }
} // namespace Mantid
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment