Skip to content
Snippets Groups Projects
Commit 1f7c9842 authored by Janick Gerstenberger's avatar Janick Gerstenberger
Browse files

Add test to check expected behaviour of `disableCopyMove`

parent dca8f96b
No related branches found
No related tags found
1 merge request!383fix disableCopyMove for empty arguments
......@@ -256,6 +256,8 @@ dune_add_test(SOURCES to_unique_ptrtest.cc
dune_add_test(SOURCES tupleutilitytest.cc)
dune_add_test(SOURCES typeutilitytest.cc)
dune_add_test(SOURCES typelisttest.cc
LINK_LIBRARIES dunecommon)
......
// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
// vi: set et ts=4 sw=2 sts=2:
#if HAVE_CONFIG_H
#include "config.h"
#endif
#include <type_traits>
#include <dune/common/typeutilities.hh>
//////////////////////////////////////////////////////////////////////
//
// check disableCopyMove
//
struct Foo {
template< class ...Args, Dune::disableCopyMove< Foo, Args ... > = 0 >
Foo( Args&& ... )
{}
Foo( const Foo& ) = delete;
Foo( Foo&& ) = delete;
};
static_assert( std::is_default_constructible< Foo >::value, "Foo is not default constructible." );
static_assert( not std::is_copy_constructible< Foo >::value, "Foo is copy constructible." );
static_assert( not std::is_move_constructible< Foo >::value, "Foo is move constructible." );
int main()
{}
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