diff --git a/explicit-templates/Hund.cpp b/explicit-templates/Hund.cpp index b7cc17d72ca653079ade50d8628abeed8dc65033..d6b23e51595a7876e242c30d045fab7bb959de66 100644 --- a/explicit-templates/Hund.cpp +++ b/explicit-templates/Hund.cpp @@ -6,12 +6,7 @@ void Hund<FOO>::bar(){ bellen<FOO>(); } -template< class FOO> -void bellen(){ - std::cout << "wuff" << std::endl; -} - template class Hund<double>; -//template void bellen<double>(); +template void bellen<double>(); diff --git a/explicit-templates/Hund.hpp b/explicit-templates/Hund.hpp index fc6f0169e40f31e4f6256e7f0e2f18c45269b507..76ffe87dbfa2e962188bb3d4e4f266c4a80d5b3c 100644 --- a/explicit-templates/Hund.hpp +++ b/explicit-templates/Hund.hpp @@ -1,4 +1,5 @@ #pragma once +#include <iostream> template< class FOO> class Hund { @@ -6,7 +7,9 @@ class Hund { void bar(); }; -template <class FOO> -void bellen(); +template< class FOO> +void bellen(){ + std::cout << "wuff" << std::endl; +} -//extern template void bellen<double>(); \ No newline at end of file +extern template void bellen<double>(); \ No newline at end of file