Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove invalid nondependent static assert #1186

Merged
merged 3 commits into from
Jul 12, 2019
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: 4 additions & 0 deletions Release/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,10 @@ elseif(CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
if (WINDOWS_STORE OR WINDOWS_PHONE)
add_compile_options(/ZW)
endif()

if (NOT (MSVC_VERSION LESS 1920))
add_compile_options(/permissive-)
endif()
else()
message("-- Unknown compiler, success is doubtful.")
message("CMAKE_CXX_COMPILER_ID=${CMAKE_CXX_COMPILER_ID}")
Expand Down
18 changes: 6 additions & 12 deletions Release/include/cpprest/streams.h
Original file line number Diff line number Diff line change
Expand Up @@ -528,9 +528,12 @@ class type_parser
public:
static pplx::task<T> parse(streams::streambuf<CharType> buffer)
{
typename _type_parser_integral_traits<T>::_is_integral ii;
typename _type_parser_integral_traits<T>::_is_unsigned ui;
return _parse(buffer, ii, ui);
typedef typename _type_parser_integral_traits<T>::_is_integral ii;
typedef typename _type_parser_integral_traits<T>::_is_unsigned ui;

static_assert(ii::value || !ui::value, "type is not supported for extraction from a stream");

return _parse(buffer, ii {}, ui {});
}

private:
Expand All @@ -539,15 +542,6 @@ class type_parser
_parse_floating_point(buffer);
}

static pplx::task<T> _parse(streams::streambuf<CharType>, std::false_type, std::true_type)
{
#ifdef _WIN32
static_assert(false, "type is not supported for extraction from a stream");
#else
throw std::runtime_error("type is not supported for extraction from a stream");
#endif
}

static pplx::task<T> _parse(streams::streambuf<CharType> buffer, std::true_type, std::false_type)
{
return type_parser<CharType, int64_t>::parse(buffer).then([](pplx::task<int64_t> op) -> T {
Expand Down