Skip to content
Snippets Groups Projects
Commit 8028326d authored by Martin Nolte's avatar Martin Nolte
Browse files

gcc-4.1.2 would produce a warning when checking conversion from 'int' to 'double'

[[Imported from SVN: r5321]]
parent 27d42a15
No related branches found
No related tags found
No related merge requests found
......@@ -40,3 +40,4 @@ testfassign2
testfassign3
testfassign4
smallobject
conversiontest
......@@ -9,7 +9,8 @@ TESTPROGS = parsetest test-stack arraylisttest smartpointertest \
testfassign1 testfassign2 testfassign3 \
testfassign4 \
testfassign_fail1 testfassign_fail2 testfassign_fail3 \
testfassign_fail4 testfassign_fail5 testfassign_fail6
testfassign_fail4 testfassign_fail5 testfassign_fail6 \
conversiontest
# which tests to run
COMPILE_XFAIL=$(DUNE_COMMON_ROOT)/bin/xfail-compile-tests
......@@ -122,6 +123,8 @@ testfassign_fail5_CPPFLAGS = $(AM_CPPFLAGS) -D_N=2 -D_M=2 -D_VALUES="1, 2"
testfassign_fail6_SOURCES = testfassign.cc
testfassign_fail6_CPPFLAGS = $(AM_CPPFLAGS) -D_N=2 -D_M=2 -D_VALUES="1, 2, nextRow, 2, 3, nextRow, 4, 5"
conversiontest_SOURCES = conversiontest.cc
sourcescheck_NOSOURCES = exprtmpl.cc timing.cc
include $(top_srcdir)/am/global-rules
// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
// vi: set et ts=4 sw=2 sts=2:
#include <iostream>
#include <dune/common/typetraits.hh>
int main ()
{
std :: cout << "Conversion from int to double exists? "
<< Dune::Conversion< int, double > :: exists << std :: endl;
return 0;
}
......@@ -218,6 +218,17 @@ namespace Dune
};
};
template<>
class Conversion< int, double >
{
public:
enum {
exists = true,
isTwoWay = false,
sameType = false
};
};
template<class T>
class Conversion<T,T>{
public:
......
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