From 7cf3c626888ac9f3adc4e18ab119af813ad1dcef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?B=C3=A5rd=20Skaflestad?= Date: Fri, 2 Dec 2011 15:16:35 +0100 Subject: [PATCH] Declare explicit overloads for ints and doubles. Implement in terms of existing function template. --- readvector.cpp | 22 +++++++++++++++++++--- readvector.hpp | 11 +++-------- 2 files changed, 22 insertions(+), 11 deletions(-) diff --git a/readvector.cpp b/readvector.cpp index 6b59ef35..aae5869d 100644 --- a/readvector.cpp +++ b/readvector.cpp @@ -1,4 +1,13 @@ -/* Copyright 2010 (c) Jostein R. Natvig */ +/*=========================================================================== +// +// Author: Jostein R. Natvig +// +//==========================================================================*/ + + +/* + Copyright 2011 SINTEF ICT, Applied Mathematics. +*/ #include @@ -260,5 +269,12 @@ void read_vector_from_file(const char *fn, std::vector& v) } -template void read_vector_from_file(const char *fn, std::vector& v); -template void read_vector_from_file(const char *fn, std::vector& v); +void read_vector_from_file(const char *fn, std::vector& v) +{ + read_vector_from_file(fn, v); +} + +void read_vector_from_file(const char *fn, std::vector& v) +{ + read_vector_from_file(fn, v); +} diff --git a/readvector.hpp b/readvector.hpp index 8178db6a..5f96fcca 100644 --- a/readvector.hpp +++ b/readvector.hpp @@ -4,11 +4,7 @@ // // Created: 2011-11-30 09:35:14+0100 // -// Authors: Ingeborg S. Ligaarden -// Jostein R. Natvig -// Halvor M. Nilsen -// Atgeirr F. Rasmussen -// Bård Skaflestad +// Author: Jostein R. Natvig // //==========================================================================*/ @@ -20,8 +16,7 @@ #ifndef READVECTOR_HPP_HEADER #define READVECTOR_HPP_HEADER - -template -void read_vector_from_file(const char *fn, std::vector& v); +void read_vector_from_file(const char *fn, std::vector& v); +void read_vector_from_file(const char *fn, std::vector& v); #endif /* READVECTOR_HPP_HEADER */