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

Remove transition code for DUNE_FIELDVECTOR_SIZE_IS_METHOD.

[[Imported from SVN: r6801]]
parent c84896e4
No related branches found
No related tags found
No related merge requests found
......@@ -16,15 +16,6 @@
#include "densevector.hh"
#include "static_assert.hh"
#if ! DUNE_COMMON_FIELDVECTOR_SIZE_IS_METHOD
#warning The FieldVector class exports its size by the enum member 'size'.\
This behavior is deprecated. In the future, 'size' will be a method,\
which puts it in compliance with the stl conventions. To enable the new behavior\
(and get rid of this warning), build your Dune with --enable-fieldvector-size-is-method.\
If you do need the vector size as an enum, use 'dimension'.
#endif
namespace Dune {
/** @addtogroup DenseMatVec
......@@ -102,11 +93,6 @@ namespace Dune {
enum {
//! The size of this vector.
dimension = SIZE
#if ! DUNE_COMMON_FIELDVECTOR_SIZE_IS_METHOD
,
//! The size of this vector.
size = SIZE
#endif
};
typedef typename Base::size_type size_type;
......@@ -212,11 +198,6 @@ namespace Dune {
enum {
//! The size of this vector.
dimension = 1
#if ! DUNE_COMMON_FIELDVECTOR_SIZE_IS_METHOD
,
//! The size of this vector.
size = 1
#endif
};
typedef typename Base::size_type size_type;
......
......@@ -93,9 +93,7 @@ struct FieldVectorMainTest
// test container methods
typename FieldVector<ft,d>::size_type size DUNE_UNUSED = FieldVector<ft,d>::dimension;
#if DUNE_COMMON_FIELDVECTOR_SIZE_IS_METHOD
size = w.size();
#endif
}
};
......
......@@ -28,7 +28,6 @@ ALLM4S = \
dune_deprecated.m4 \
dune_deprecated_cppflags.m4 \
dune_docu.m4 \
dune_fieldvector_size_is_method.m4 \
dune_linkcxx.m4 \
dune_mpi.m4 \
dune_streams.m4 \
......
......@@ -31,11 +31,6 @@ AC_DEFUN([DUNE_COMMON_CHECKS],
AC_REQUIRE([DUNE_MPI])
AC_REQUIRE([DUNE_TR1_HEADERS])
dnl Create the flag --enable-fieldvector-size-is-method
dnl This is to orchestrate the transition from the constant member FieldVector::size
dnl to the method FieldVector::size()
AC_REQUIRE([DUNE_FIELDVECTOR_SIZE_IS_METHOD])
dnl check for programs
AC_REQUIRE([AC_PROG_CC])
# add -Wall if the compiler is gcc
......
dnl This macro introduces a configure flag --enable-fieldvector-size-is method
dnl that is used to orchestrate the transition from FieldVector::size as an enum
dnl and FieldVector::size() as a method (see FS 819 for details).
dnl If this flag is not set (the default), then FieldVector::size is an enum,
dnl but a compiler warning appears. If it is set then the warning disappears,
dnl but FieldVector::size() becomes a method.
dnl
dnl This flag and the corresponding preprocessor directives should be removed
dnl not earlier than after dune-2.2 has been released.
AC_DEFUN([DUNE_FIELDVECTOR_SIZE_IS_METHOD],[
AC_ARG_ENABLE(fieldvector-size-is-method,
AS_HELP_STRING([--enable-fieldvector-size-is-method],[If this is set, the member 'size' of FieldVector is a method rather than an enum]))
AS_IF([test "x$enable_fieldvector_size_is_method" = "xyes"],
AC_DEFINE(DUNE_COMMON_FIELDVECTOR_SIZE_IS_METHOD, 1, [If this is set, the member 'size' of FieldVector is a method rather than an enum]))
])
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