0
0
mirror of https://github.com/rbock/sqlpp11.git synced 2024-11-15 20:31:16 +08:00

Compile with both, MSVC 2015 and 2017

Make MSVC 2017 accept the code as well

MSVC still has problems with variadic templates...

Adjust README, do not do debug build (reduce load for appveyor)
This commit is contained in:
rbock 2017-06-25 10:02:41 +02:00
parent 8113a5f1fc
commit 7422cb9e3b
4 changed files with 22 additions and 9 deletions

View File

@ -1,10 +1,12 @@
os: Visual Studio 2015
os:
- Visual Studio 2015
- Visual Studio 2017
platform:
- x64
configuration:
- Debug
#- Debug
- Release
matrix:

View File

@ -17,7 +17,7 @@ See [Changes](ChangeLog.md)
Status:
-------
Branch / Compiler | clang-3.4, gcc-4.9, Xcode-7 | MSVC 2015 | Test Coverage
Branch / Compiler | clang-3.4, gcc-4.9, Xcode-7 | MSVC 2015/2017 | Test Coverage
------------------| -------------------------------|-------------|---------------
master | [![Build Status](https://travis-ci.org/rbock/sqlpp11.svg?branch=master)](https://travis-ci.org/rbock/sqlpp11?branch=master) | [![Build status](https://ci.appveyor.com/api/projects/status/eid7mwqgavo0h61h/branch/master?svg=true)](https://ci.appveyor.com/project/rbock/sqlpp11/branch/master) | [![Coverage Status](https://coveralls.io/repos/rbock/sqlpp11/badge.svg?branch=master)](https://coveralls.io/r/rbock/sqlpp11?branch=master)
develop | [![Build Status](https://travis-ci.org/rbock/sqlpp11.svg?branch=develop)](https://travis-ci.org/rbock/sqlpp11?branch=develop) | [![Build status](https://ci.appveyor.com/api/projects/status/eid7mwqgavo0h61h/branch/develop?svg=true)](https://ci.appveyor.com/project/rbock/sqlpp11/branch/develop) | [![Coverage Status](https://coveralls.io/repos/rbock/sqlpp11/badge.svg?branch=develop)](https://coveralls.io/r/rbock/sqlpp11?branch=develop)

View File

@ -181,6 +181,12 @@ namespace sqlpp
static_check_t<not std::is_same<Database, void>::value, assert_having_dynamic_statement_dynamic_t>,
check_having_t<Expression>>;
template <typename... Exprs>
constexpr auto are_all_parameters_expressions() -> bool
{
return logic::all_t<is_expression_t<Exprs>::value...>::value;
}
// NO HAVING YET
struct no_having_t
{
@ -237,7 +243,7 @@ namespace sqlpp
// template <typename... T>
// using _check = logic::all_t<is_expression_t<T>::value...>;
template <typename... T>
struct _check : logic::all_t<is_expression_t<T>::value...>
struct _check : std::integral_constant<bool, are_all_parameters_expressions<T...>()>
{
};

View File

@ -54,6 +54,12 @@ namespace sqlpp
namespace detail
{
template <typename... Policies>
constexpr auto is_any_policy_missing() -> bool
{
return logic::any_t<is_missing_t<Policies>::value...>::value;
}
template <typename Db = void, typename... Policies>
struct statement_policies_t
{
@ -122,11 +128,10 @@ namespace sqlpp
}
using _value_type =
typename std::conditional<logic::none_t<is_missing_t<Policies>::value...>::value,
value_type_of<_result_type_provider>,
no_value_t // if a required statement part is missing (e.g. columns in a select),
// then the statement cannot be used as a value
>::type;
typename std::conditional<is_any_policy_missing<Policies...>(),
no_value_t, // if a required statement part is missing (e.g. columns in a select),
// then the statement cannot be used as a value
value_type_of<_result_type_provider>>::type;
using _traits =
make_traits<_value_type, tag_if<tag::is_expression, not std::is_same<_value_type, no_value_t>::value>>;