Renamed namespace to 'gsl'. Renamed macro to configure testing.

This commit is contained in:
Neil MacIntosh committed 2015-09-29 16:41:37 -07:00
1 parent d023ad51a7
commit ef626fd33a
14 files changed
+25 -25

No files matched your search

+4 -4
View File
@@ -39,7 +39,7 @@
#ifndef _NOEXCEPT
#ifdef SAFER_CPP_TESTING
#ifdef GSL_THROWS_FOR_TESTING
#define _NOEXCEPT
#else
#define _NOEXCEPT noexcept
@@ -47,7 +47,7 @@
#else // _NOEXCEPT
#ifdef SAFER_CPP_TESTING
#ifdef GSL_THROWS_FOR_TESTING
#undef _NOEXCEPT
#define _NOEXCEPT
#endif
@@ -59,7 +59,7 @@
#pragma warning(disable: 4351) // warns about newly introduced aggregate initializer behavior
#endif // _MSC_VER <= 1800
namespace Guide {
namespace gsl {
/*
** begin definitions of index and bounds
@@ -2279,7 +2279,7 @@ general_array_view_iterator<ArrayView> operator+(typename general_array_view_ite
return rhs + n;
}
} // namespace Guide
} // namespace gsl
#if defined(_MSC_VER)
#undef constexpr
+3 -3
View File
@@ -22,14 +22,14 @@
#include <exception>
#include <stdexcept>
namespace Guide
namespace gsl
{
//
// Having "fail fast" result in an exception makes unit testing
// the GSL classes that rely upon it much simpler.
//
#if defined(SAFER_CPP_TESTING)
#if defined(GSL_THROWS_FOR_TESTING)
struct fail_fast : public std::runtime_error
{
@@ -45,7 +45,7 @@ inline void fail_fast_assert(bool cond, const char* const message) { if (!cond)
inline void fail_fast_assert(bool cond) { if (!cond) std::terminate(); }
inline void fail_fast_assert(bool cond, const char* const) { if (!cond) std::terminate(); }
#endif // SAFER_CPP_TESTING
#endif // GSL_THROWS_FOR_TESTING
}
+4 -4
View File
@@ -23,7 +23,7 @@
#include "string_view.h" // zstring, string_view, zstring_builder...
#include <memory>
namespace Guide
namespace gsl
{
//
@@ -38,8 +38,8 @@ using owner = T;
//
// GSL.assert: assertions
//
#define Expects(x) Guide::fail_fast_assert((x))
#define Ensures(x) Guide::fail_fast_assert((x))
#define Expects(x) gsl::fail_fast_assert((x))
#define Ensures(x) gsl::fail_fast_assert((x))
//
// GSL.util: utilities
@@ -354,6 +354,6 @@ private:
template<class T> using maybe_null = maybe_null_ret<T>;
} // namespace Guide
} // namespace gsl
#endif // GSL_GSL_H
+2 -2
View File
@@ -22,7 +22,7 @@
#include "array_view.h"
#include <cstring>
namespace Guide
namespace gsl
{
//
// czstring and wzstring
@@ -164,7 +164,7 @@ public:
size_type length() const { return sv_.length(); }
pointer assume0() const { return data(); }
string_view_type ensure_z() const { return Guide::ensure_z(sv_); }
string_view_type ensure_z() const { return gsl::ensure_z(sv_); }
iterator begin() const { return sv_.begin(); }
iterator end() const { return sv_.end(); }