Skip to content
Snippets Groups Projects
Commit ba40259a authored by Christoph Grüninger's avatar Christoph Grüninger
Browse files

[cleanup] Remove check and fallback code for initializer list.

parent eaccce7e
No related branches found
No related tags found
No related merge requests found
......@@ -14,7 +14,6 @@
# HAVE_VARIADIC_CONSTRUCTOR_SFINAE True if variadic constructor sfinae is supported
# HAVE_RVALUE_REFERENCES True if rvalue references are supported
# HAVE_STD_CONDITIONAL True if std::conditional is supported
# HAVE_INITIALIZER_LIST True if initializer list is supported
# HAVE_CONSTEXPR True if constexpr is supported
# HAVE_KEYWORD_FINAL True if final is supported.
......@@ -293,28 +292,6 @@ check_cxx_source_compiles("
" HAVE_STD_CONDITIONAL
)
# initializer list
check_cxx_source_compiles("
#include <initializer_list>
#include <vector>
struct A
{
A(std::initializer_list<int> il)
: vec(il)
{}
std::vector<int> vec;
};
int main(void)
{
A a{1,3,4,5};
return 0;
}
" HAVE_INITIALIZER_LIST
)
# constexpr
check_cxx_source_compiles("
constexpr int foo()
......
......@@ -154,9 +154,6 @@
/* Define to 1 if rvalue references are supported */
#cmakedefine HAVE_RVALUE_REFERENCES 1
/* Define to 1 if initializer list is supported */
#cmakedefine HAVE_INITIALIZER_LIST 1
/* Define to 1 if C++11 constexpr is supported */
#cmakedefine HAVE_CONSTEXPR 1
......
......@@ -105,20 +105,8 @@ namespace Dune {
//! Constructor making default-initialized vector
FieldVector()
// Use C++11 unified initialization if available - tends to generate
// fastest code
#if HAVE_INITIALIZER_LIST
: _data{}
{}
#else
{
// fall back to library approach - this gives faster code than array placement
// new. Apart from that, placement new may create problems if K is a complex
// type. In that case, the default constructor of the _data elements has already
// been called and may have allocated memory.
std::fill(_data.begin(),_data.end(),K());
}
#endif
//! Constructor making vector with identical coordinates
explicit FieldVector (const K& t)
......
......@@ -13,7 +13,6 @@ install(PROGRAMS
cxx0x_variadic.m4
cxx0x_variadic_constructor_sfinae.m4
cxx11_constexpr.m4
cxx11_initializer_list.m4
cxx11_conditional.m4
cxx11_final.m4
dune.m4
......
......@@ -15,7 +15,6 @@ ALLM4S = \
cxx0x_nullptr.m4 \
cxx0x_variadic.m4 \
cxx0x_variadic_constructor_sfinae.m4 \
cxx11_initializer_list.m4 \
cxx11_conditional.m4 \
cxx11_constexpr.m4 \
cxx11_final.m4 \
......
# tests for C++11 initializer list support
# the associated macro is called HAVE_INITIALIZER_LIST
AC_DEFUN([INITIALIZER_LIST_CHECK],[
AC_CACHE_CHECK([whether std::initializer_list is supported], dune_cv_initializer_list_support, [
AC_REQUIRE([AC_PROG_CXX])
AC_REQUIRE([GXX0X])
AC_LANG_PUSH([C++])
AC_RUN_IFELSE([
AC_LANG_PROGRAM([
#include <initializer_list>
#include <vector>
struct A
{
A(std::initializer_list<int> il)
: vec(il)
{}
std::vector<int> vec;
};
],
[
A a{1,3,4,5};
return 0;
])],
dune_cv_initializer_list_support=yes,
dune_cv_initializer_list_support=no)
AC_LANG_POP
])
if test "x$dune_cv_initializer_list_support" = xyes; then
AC_DEFINE(HAVE_INITIALIZER_LIST, 1, [Define to 1 if std::initializer_list is supported])
fi
])
......@@ -23,7 +23,6 @@ AC_DEFUN([DUNE_COMMON_CHECKS],
AC_REQUIRE([SHARED_PTR])
AC_REQUIRE([VARIADIC_TEMPLATES_CHECK])
AC_REQUIRE([RVALUE_REFERENCES_CHECK])
AC_REQUIRE([INITIALIZER_LIST_CHECK])
AC_REQUIRE([CXX11_CONDITIONAL_CHECK])
AC_REQUIRE([CXX11_CONSTEXPR_CHECK])
AC_REQUIRE([DUNE_BOOST_BASE])
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment