Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -170,8 +170,8 @@ architectures.
9. Invoke `cd STL`
10. Invoke `cmake -G Ninja -DCMAKE_TOOLCHAIN_FILE={where your vcpkg clone is located}\scripts\buildsystems\vcpkg.cmake
-S . -B {wherever you want binaries}` to configure the project. For example, `cmake -G Ninja
-DCMAKE_TOOLCHAIN_FILE=C:\Dev\vcpkg\scripts\buildsystems\vcpkg.cmake -S . -B build.x64`
11. Invoke `ninja -C {wherever you want binaries}` to build the project. For example, `ninja -C build.x64`
-DCMAKE_TOOLCHAIN_FILE=C:\Dev\vcpkg\scripts\buildsystems\vcpkg.cmake -S . -B out\build\x64`
11. Invoke `ninja -C {wherever you want binaries}` to build the project. For example, `ninja -C out\build\x64`

# How To Consume

Expand Down
6 changes: 2 additions & 4 deletions stl/inc/experimental/filesystem
Original file line number Diff line number Diff line change
Expand Up @@ -1370,14 +1370,12 @@ private:
path _Mypval1;
path _Mypval2;

#if _HAS_EXCEPTIONS

#else // _HAS_EXCEPTIONS
#if !_HAS_EXCEPTIONS
protected:
virtual __CLR_OR_THIS_CALL void _Doraise() const override { // perform class-specific exception handling
_RAISE(*this);
}
#endif // _HAS_EXCEPTIONS
#endif // !_HAS_EXCEPTIONS
};

[[noreturn]] inline void _Throw_filesystem_error(const char* const _Message) {
Expand Down
6 changes: 2 additions & 4 deletions stl/inc/filesystem
Original file line number Diff line number Diff line change
Expand Up @@ -1794,14 +1794,12 @@ namespace filesystem {
path _Path2;
string _What;

#if _HAS_EXCEPTIONS

#else // _HAS_EXCEPTIONS
#if !_HAS_EXCEPTIONS
protected:
virtual void _Doraise() const override { // perform class-specific exception handling
_RAISE(*this);
}
#endif // _HAS_EXCEPTIONS
#endif // !_HAS_EXCEPTIONS
};

[[noreturn]] inline void _Throw_fs_error(const char* _Op, __std_win_error _Error) {
Expand Down
10 changes: 5 additions & 5 deletions stl/inc/functional
Original file line number Diff line number Diff line change
Expand Up @@ -1366,9 +1366,9 @@ struct _Select_fixer<_Cv_TiD, false, true, 0> { // nested bind fixer
#pragma warning(pop)

template <class _Untuple>
static auto _Fix(_Cv_TiD& _Tid, _Untuple&& _Ut) -> decltype(_Apply(_Tid, _STD move(_Ut),
make_index_sequence<tuple_size_v<_Untuple>>())) { // call a nested bind expression
return _Apply(_Tid, _STD move(_Ut), make_index_sequence<tuple_size_v<_Untuple>>());
static auto _Fix(_Cv_TiD& _Tid, _Untuple&& _Ut) -> decltype(
_Apply(_Tid, _STD move(_Ut), make_index_sequence<tuple_size_v<_Untuple>>{})) { // call a nested bind expression
return _Apply(_Tid, _STD move(_Ut), make_index_sequence<tuple_size_v<_Untuple>>{});
}
};

Expand Down Expand Up @@ -1439,9 +1439,9 @@ public:

#define _BINDER_OPERATOR(CONST_OPT) \
template <class... _Unbound> \
auto operator()(_Unbound&&... _Unbargs) CONST_OPT->decltype(_Call_binder(_Invoker_ret<_Ret>(), _Seq(), \
auto operator()(_Unbound&&... _Unbargs) CONST_OPT->decltype(_Call_binder(_Invoker_ret<_Ret>(), _Seq{}, \
_Mypair._Get_first(), _Mypair._Myval2, _STD forward_as_tuple(_STD forward<_Unbound>(_Unbargs)...))) { \
return _Call_binder(_Invoker_ret<_Ret>(), _Seq(), _Mypair._Get_first(), _Mypair._Myval2, \
return _Call_binder(_Invoker_ret<_Ret>(), _Seq{}, _Mypair._Get_first(), _Mypair._Myval2, \
_STD forward_as_tuple(_STD forward<_Unbound>(_Unbargs)...)); \
}

Expand Down
6 changes: 2 additions & 4 deletions stl/inc/future
Original file line number Diff line number Diff line change
Expand Up @@ -139,14 +139,12 @@ public:
return _Future_error_map(_Mycode.value());
}

#if _HAS_EXCEPTIONS

#else // _HAS_EXCEPTIONS
#if !_HAS_EXCEPTIONS
protected:
virtual void _Doraise() const override { // perform class-specific exception handling
_RAISE(*this);
}
#endif // _HAS_EXCEPTIONS
#endif // !_HAS_EXCEPTIONS

private:
error_code _Mycode; // the stored error code
Expand Down
8 changes: 4 additions & 4 deletions stl/inc/mutex
Original file line number Diff line number Diff line change
Expand Up @@ -518,8 +518,8 @@ auto _Invoke_stored_explicit(tuple<_Types...>&& _Tuple, index_sequence<_Indices.
// FUNCTION TEMPLATE _Invoke_stored
template <class... _Types>
auto _Invoke_stored(tuple<_Types...>&& _Tuple)
-> decltype(_Invoke_stored_explicit(_STD move(_Tuple), index_sequence_for<_Types...>())) { // invoke() a tuple
return _Invoke_stored_explicit(_STD move(_Tuple), index_sequence_for<_Types...>());
-> decltype(_Invoke_stored_explicit(_STD move(_Tuple), index_sequence_for<_Types...>{})) { // invoke() a tuple
return _Invoke_stored_explicit(_STD move(_Tuple), index_sequence_for<_Types...>{});
}

// FUNCTION TEMPLATE call_once
Expand All @@ -530,9 +530,9 @@ int __stdcall _Callback_once(void*, void* _Pv, void**) { // adapt call_once() to
_Tuple* _Ptup = static_cast<_Tuple*>(_Pv);

_TRY_BEGIN
// Note explicit _Seq() selects every element from *_Ptup except the last,
// Note explicit _Seq{} selects every element from *_Ptup except the last,
// which contains call_once's exception_ptr.
_Invoke_stored_explicit(_STD move(*_Ptup), _Seq());
_Invoke_stored_explicit(_STD move(*_Ptup), _Seq{});
_CATCH_ALL
auto& _Ref = _STD get<_Idx>(*_Ptup);
_Ref = _STD current_exception();
Expand Down
54 changes: 18 additions & 36 deletions stl/inc/stdexcept
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,12 @@ public:

explicit logic_error(const char* _Message) : _Mybase(_Message) {}

#if _HAS_EXCEPTIONS

#else // _HAS_EXCEPTIONS
#if !_HAS_EXCEPTIONS
protected:
virtual void _Doraise() const override { // perform class-specific exception handling
_RAISE(*this);
}
#endif // _HAS_EXCEPTIONS
#endif // !_HAS_EXCEPTIONS
};

// CLASS domain_error
Expand All @@ -46,14 +44,12 @@ public:

explicit domain_error(const char* _Message) : _Mybase(_Message) {}

#if _HAS_EXCEPTIONS

#else // _HAS_EXCEPTIONS
#if !_HAS_EXCEPTIONS
protected:
virtual void _Doraise() const override { // perform class-specific exception handling
_RAISE(*this);
}
#endif // _HAS_EXCEPTIONS
#endif // !_HAS_EXCEPTIONS
};

// CLASS invalid_argument
Expand All @@ -65,14 +61,12 @@ public:

explicit invalid_argument(const char* _Message) : _Mybase(_Message) {}

#if _HAS_EXCEPTIONS

#else // _HAS_EXCEPTIONS
#if !_HAS_EXCEPTIONS
protected:
virtual void _Doraise() const override { // perform class-specific exception handling
_RAISE(*this);
}
#endif // _HAS_EXCEPTIONS
#endif // !_HAS_EXCEPTIONS
};

// CLASS length_error
Expand All @@ -84,14 +78,12 @@ public:

explicit length_error(const char* _Message) : _Mybase(_Message) {}

#if _HAS_EXCEPTIONS

#else // _HAS_EXCEPTIONS
#if !_HAS_EXCEPTIONS
protected:
virtual void _Doraise() const override { // perform class-specific exception handling
_RAISE(*this);
}
#endif // _HAS_EXCEPTIONS
#endif // !_HAS_EXCEPTIONS
};

// CLASS out_of_range
Expand All @@ -103,14 +95,12 @@ public:

explicit out_of_range(const char* _Message) : _Mybase(_Message) {}

#if _HAS_EXCEPTIONS

#else // _HAS_EXCEPTIONS
#if !_HAS_EXCEPTIONS
protected:
virtual void _Doraise() const override { // perform class-specific exception handling
_RAISE(*this);
}
#endif // _HAS_EXCEPTIONS
#endif // !_HAS_EXCEPTIONS
};

// CLASS runtime_error
Expand All @@ -122,14 +112,12 @@ public:

explicit runtime_error(const char* _Message) : _Mybase(_Message) {}

#if _HAS_EXCEPTIONS

#else // _HAS_EXCEPTIONS
#if !_HAS_EXCEPTIONS
protected:
virtual void _Doraise() const override { // perform class-specific exception handling
_RAISE(*this);
}
#endif // _HAS_EXCEPTIONS
#endif // !_HAS_EXCEPTIONS
};

// CLASS overflow_error
Expand All @@ -141,14 +129,12 @@ public:

explicit overflow_error(const char* _Message) : _Mybase(_Message) {}

#if _HAS_EXCEPTIONS

#else // _HAS_EXCEPTIONS
#if !_HAS_EXCEPTIONS
protected:
virtual void _Doraise() const override { // perform class-specific exception handling
_RAISE(*this);
}
#endif // _HAS_EXCEPTIONS
#endif // !_HAS_EXCEPTIONS
};

// CLASS underflow_error
Expand All @@ -160,14 +146,12 @@ public:

explicit underflow_error(const char* _Message) : _Mybase(_Message) {}

#if _HAS_EXCEPTIONS

#else // _HAS_EXCEPTIONS
#if !_HAS_EXCEPTIONS
protected:
virtual void _Doraise() const override { // perform class-specific exception handling
_RAISE(*this);
}
#endif // _HAS_EXCEPTIONS
#endif // !_HAS_EXCEPTIONS
};

// CLASS range_error
Expand All @@ -179,14 +163,12 @@ public:

explicit range_error(const char* _Message) : _Mybase(_Message) {}

#if _HAS_EXCEPTIONS

#else // _HAS_EXCEPTIONS
#if !_HAS_EXCEPTIONS
protected:
virtual void _Doraise() const override { // perform class-specific exception handling
_RAISE(*this);
}
#endif // _HAS_EXCEPTIONS
#endif // !_HAS_EXCEPTIONS
};

[[noreturn]] inline void _Throw_range_error(const char* const _Message) {
Expand Down
6 changes: 2 additions & 4 deletions stl/inc/system_error
Original file line number Diff line number Diff line change
Expand Up @@ -425,14 +425,12 @@ public:
return _Mycode;
}

#if _HAS_EXCEPTIONS

#else // _HAS_EXCEPTIONS
#if !_HAS_EXCEPTIONS
protected:
virtual void _Doraise() const override { // perform class-specific exception handling
_RAISE(*this);
}
#endif // _HAS_EXCEPTIONS
#endif // !_HAS_EXCEPTIONS
};

[[noreturn]] inline void _Throw_system_error(const errc _Errno) {
Expand Down
2 changes: 1 addition & 1 deletion stl/inc/tuple
Original file line number Diff line number Diff line change
Expand Up @@ -1004,7 +1004,7 @@ pair<_Ty1, _Ty2>::pair(_Tuple1& _Val1, _Tuple2& _Val2, index_sequence<_Indexes1.
template <class _Ty1, class _Ty2>
template <class... _Types1, class... _Types2>
pair<_Ty1, _Ty2>::pair(piecewise_construct_t, tuple<_Types1...> _Val1, tuple<_Types2...> _Val2)
: pair(_Val1, _Val2, index_sequence_for<_Types1...>(), index_sequence_for<_Types2...>()) {}
: pair(_Val1, _Val2, index_sequence_for<_Types1...>{}, index_sequence_for<_Types2...>{}) {}

// STRUCT TEMPLATE uses_allocator
template <class... _Types, class _Alloc>
Expand Down
4 changes: 2 additions & 2 deletions stl/inc/typeinfo
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ _STD_BEGIN
// size in pointers of std::function and std::any (roughly 3 pointers larger than std::string when building debug)
constexpr int _Small_object_num_ptrs = 6 + 16 / sizeof(void*);

#if !(_HAS_EXCEPTIONS)
#if !_HAS_EXCEPTIONS

// CLASS bad_cast
class _CRTIMP2_IMPORT bad_cast : public exception { // base of all bad cast exceptions
Expand Down Expand Up @@ -59,7 +59,7 @@ class _CRTIMP2_IMPORT __non_rtti_object : public bad_typeid { // report a non RT
public:
__non_rtti_object(const char* _Message) : bad_typeid(_Message) {}
};
#endif // _HAS_EXCEPTIONS
#endif // !_HAS_EXCEPTIONS

[[noreturn]] inline void _Throw_bad_cast() {
_THROW(bad_cast{});
Expand Down
6 changes: 2 additions & 4 deletions stl/inc/xiosbase
Original file line number Diff line number Diff line change
Expand Up @@ -206,14 +206,12 @@ public:
: system_error(_Errcode, _Message) { // construct with message
}

#if _HAS_EXCEPTIONS

#else // _HAS_EXCEPTIONS
#if !_HAS_EXCEPTIONS
protected:
virtual void _Doraise() const override { // report the exception
_RAISE(*this);
}
#endif // _HAS_EXCEPTIONS
#endif // !_HAS_EXCEPTIONS
};

// CLASS Init
Expand Down
1 change: 0 additions & 1 deletion stl/inc/yvals.h
Original file line number Diff line number Diff line change
Expand Up @@ -441,7 +441,6 @@ class _CRTIMP2_PURE_IMPORT _Init_locks { // initialize mutexes
catch (...) {
#define _CATCH_END }

#define _RAISE(x) throw x
#define _RERAISE throw
#define _THROW(x) throw x

Expand Down
15 changes: 8 additions & 7 deletions stl/src/_tolower.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ _CRTIMP2_PURE int __CLRCALL_PURE_OR_CDECL _Tolower(int c, const _Ctypevec* ploc)
UINT codepage;
const wchar_t* locale_name;

if (ploc == 0) {
if (ploc == nullptr) {
locale_name = ___lc_locale_name_func()[LC_CTYPE];
codepage = ___lc_codepage_func();
} else {
Expand All @@ -58,8 +58,8 @@ _CRTIMP2_PURE int __CLRCALL_PURE_OR_CDECL _Tolower(int c, const _Ctypevec* ploc)
}

// if checking case of c does not require API call, do it
if ((unsigned) c < 256) {
if (ploc == 0) {
if (static_cast<unsigned int>(c) < 256) {
if (ploc == nullptr) {
if (!isupper(c)) {
return c;
}
Expand All @@ -71,7 +71,7 @@ _CRTIMP2_PURE int __CLRCALL_PURE_OR_CDECL _Tolower(int c, const _Ctypevec* ploc)
}

// convert int c to multibyte string
if (ploc == 0 ? _cpp_isleadbyte((c >> 8) & 0xff) : (ploc->_Table[(c >> 8) & 0xff] & _LEADBYTE) != 0) {
if (ploc == nullptr ? _cpp_isleadbyte((c >> 8) & 0xff) : (ploc->_Table[(c >> 8) & 0xff] & _LEADBYTE) != 0) {
inbuffer[0] = (c >> 8 & 0xff);
inbuffer[1] = (unsigned char) c;
inbuffer[2] = 0;
Expand All @@ -83,9 +83,10 @@ _CRTIMP2_PURE int __CLRCALL_PURE_OR_CDECL _Tolower(int c, const _Ctypevec* ploc)
}

// convert wide char to lowercase
if (0
== (size = __crtLCMapStringA(
locale_name, LCMAP_LOWERCASE, (const char*) inbuffer, size, (char*) outbuffer, 3, codepage, TRUE))) {
size = __crtLCMapStringA(locale_name, LCMAP_LOWERCASE, reinterpret_cast<const char*>(inbuffer), size,
reinterpret_cast<char*>(outbuffer), 3, codepage, TRUE);

if (size == 0) {
return c;
}

Expand Down
Loading