Skip to content

Commit

Permalink
Merge branch 'work' of https://github.com/oktonion/stdex into work
Browse files Browse the repository at this point in the history
  • Loading branch information
oktonion committed Jul 23, 2018
2 parents 6e076ec + 5961465 commit 9750504
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 19 deletions.
2 changes: 1 addition & 1 deletion stdex/include/chrono.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -906,7 +906,7 @@ namespace stdex
{
namespace chrono_literals
{
// non-standart operator >> for literals macros to work:
// non-standard operator >> for literals macros to work:
template <class _Rep, class _Period, class _Rep2>
chrono::duration<_Rep, _Period> operator,(const _Rep2 &input, const chrono::duration<_Rep, _Period> &dur)
{
Expand Down
2 changes: 1 addition & 1 deletion stdex/include/condition_variable.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ namespace stdex
};

//! Condition variable class.
//! This is a signalling object for synchronizing the execution flow for
//! This is a signaling object for synchronizing the execution flow for
//! several threads. Example usage:
//! @code
//! // Shared data and associated mutex and condition variable objects
Expand Down
2 changes: 1 addition & 1 deletion stdex/include/nullptr.h
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ namespace stdex
template<class T>
struct _nullptr_can_be_ct_constant_impl
{
// idk how to check for compile time constantness of type in gerenal for any c++98 compiler, so...
// idk how to check for compile time constantness of type in general for any c++98 compiler, so...
static const bool value = false;// (sizeof(nullptr_detail::_nullptr_can_be_ct_constant<T>(0)) == sizeof(nullptr_detail::_yes_type));
};

Expand Down
20 changes: 10 additions & 10 deletions stdex/include/ratio.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -128,10 +128,10 @@ namespace stdex
struct ratio_asserts
{
template<bool>
struct overflow_in_multiplication_assert; // if you are there means overflow in safe template multiplication occured
struct overflow_in_multiplication_assert; // if you are there means overflow in safe template multiplication occurred

template<bool>
struct internal_library_error_assert; // if you are there means internal library error occured
struct internal_library_error_assert; // if you are there means internal library error occurred

template<bool>
struct denominator_cant_be_zero_assert; // if you are there means you put the denominator to zero
Expand All @@ -143,7 +143,7 @@ namespace stdex
struct division_by_zero; // if you are there means that divider is zero

template<bool>
struct overflow_in_addition_assert; // if you are there means overflow in safe template addition occured
struct overflow_in_addition_assert; // if you are there means overflow in safe template addition occurred
};

template<>
Expand Down Expand Up @@ -214,7 +214,7 @@ namespace stdex

typedef typename check::overflow_in_addition_assert<_add_overflow_check<_Pn, _Qn>::value != 0>::
overflow_in_addition_assert_failed
check1; // if you are there means overflow in safe template addition occured
check1; // if you are there means overflow in safe template addition occurred
};

template<uintmax_t _CharBitNum>
Expand All @@ -226,7 +226,7 @@ namespace stdex
typedef intern::ratio_asserts check;
typedef typename check::internal_library_error_assert< (_CharBitNum % 2) == 0 >::
internal_library_error_assert_failed
check1; // if you are there means internal library error occured (number of bits in char is not even on your platform)
check1; // if you are there means internal library error occurred (number of bits in char is not even on your platform)
};

// [Safe multiply template]
Expand All @@ -252,16 +252,16 @@ namespace stdex

typedef typename check::overflow_in_multiplication_assert< (_safe_multiply::_a1 == 0 || _safe_multiply::_b1 == 0) >::
overflow_in_multiplication_assert_failed
check1; // if you are there means overflow in safe template multiplication occured
check1; // if you are there means overflow in safe template multiplication occurred
typedef typename check::overflow_in_multiplication_assert< (_safe_multiply::_a0 * _safe_multiply::_b1 + _safe_multiply::_b0 * _safe_multiply::_a1 < (_safe_multiply::_c / uintmax_t(2))) >::
overflow_in_multiplication_assert_failed
check2; // if you are there means overflow in safe template multiplication occured
check2; // if you are there means overflow in safe template multiplication occurred
typedef typename check::overflow_in_multiplication_assert< (_safe_multiply::_b0 * _safe_multiply::_a0 <= _intmax_t_info::signed_max) >::
overflow_in_multiplication_assert_failed
check3; // if you are there means overflow in safe template multiplication occured
check3; // if you are there means overflow in safe template multiplication occurred
typedef typename check::overflow_in_multiplication_assert< ((_safe_multiply::_a0 * _safe_multiply::_b1 + _safe_multiply::_b0 * _safe_multiply::_a1) * _safe_multiply::_c <= _intmax_t_info::signed_max - _safe_multiply::_b0 * _safe_multiply::_a0) >::
overflow_in_multiplication_assert_failed
check4; // if you are there means overflow in safe template multiplication occured
check4; // if you are there means overflow in safe template multiplication occurred

public:
static const intmax_t value = _Pn * _Qn;
Expand Down Expand Up @@ -299,7 +299,7 @@ namespace stdex
typedef intern::ratio_asserts check;
typedef typename check::internal_library_error_assert< (!(_big_less<_hi1, _lo1, _hi2, _lo2>::value != 0)) >::
internal_library_error_assert_failed
check1; // if you are there means internal library error occured
check1; // if you are there means internal library error occurred
};

// [Safe multiply for bigger numbers template]
Expand Down
4 changes: 2 additions & 2 deletions stdex/include/string.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1954,7 +1954,7 @@ namespace stdex

string result(buf);

// some compilers ignore 'f' flag of spintf and print large values with scientific notation, as if 'e' flag was passed
// some compilers ignore 'f' flag of sprintf and print large values with scientific notation, as if 'e' flag was passed
// so we are removing substrings like 'e-10' and trying to enforce the precision by slow and not so precise conversion:

detail::string_detail::_stdex_size_t_type e_pos = result.rfind('e');
Expand Down Expand Up @@ -2014,7 +2014,7 @@ namespace stdex

wstring result(buf);

// some compilers ignore 'f' flag of spintf and print large values with scientific notation, as if 'e' flag was passed
// some compilers ignore 'f' flag of swprintf and print large values with scientific notation, as if 'e' flag was passed
// so we are removing substrings like 'e-10' and trying to enforce the precision by slow and not so precise conversion:

detail::string_detail::_stdex_size_t_type e_pos = result.rfind(L'e');
Expand Down
8 changes: 4 additions & 4 deletions stdex/include/type_traits.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#pragma once
#endif // _MSC_VER > 1000

// Implemented all basic standart C++11 features.
// Implemented all basic standard C++11 features.
// What can not be implemented or implemented with some limits:
// is_class - can't detect unions
// is_enum - ni
Expand All @@ -25,7 +25,7 @@
// aligned_storage - ni
// aligned_union - ni
// underlying_type - ni
// common_type - only for arithmetic types (compares other types by size that is not standart)
// common_type - only for arithmetic types (compares other types by size that is not standard)
// All type features (like is_assignable) - ni

// stdex includes
Expand Down Expand Up @@ -630,10 +630,10 @@ namespace stdex
typedef intern::type_traits_asserts check;
typedef typename check::alignment_of_type_can_not_be_zero_assert< _alignment_of_impl::value != 0 >::
alignment_of_type_can_not_be_zero_assert_failed
check1; // if you are there means aligment of type passed can not be calculated or compiler can not handle this situation (sorry, nothing can be done there)
check1; // if you are there means alignment of type passed can not be calculated or compiler can not handle this situation (sorry, nothing can be done there)
};

// borland compilers seem to be unable to handle long double correctly, so this will do the trick:
// Borland compilers seem to be unable to handle long double correctly, so this will do the trick:
struct _long_double_wrapper{ long double value; };
}

Expand Down

0 comments on commit 9750504

Please sign in to comment.