Instantiate templates in their enclosing namespace
This commit is contained in:
parent
c6106b0f53
commit
4fa7789786
@ -120,9 +120,14 @@ value<L>::eval (double x, double y) const {
|
||||
y_fac);
|
||||
}
|
||||
|
||||
|
||||
namespace util {
|
||||
namespace noise {
|
||||
template struct value<lerp::linear>;
|
||||
template struct value<lerp::cubic>;
|
||||
template struct value<lerp::quintic>;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
@ -175,9 +180,14 @@ gradient<L>::eval (double x, double y) const {
|
||||
y_fac);
|
||||
}
|
||||
|
||||
|
||||
namespace util {
|
||||
namespace noise {
|
||||
template struct gradient<lerp::linear>;
|
||||
template struct gradient<lerp::cubic>;
|
||||
template struct gradient<lerp::quintic>;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
29
range.cpp
29
range.cpp
@ -1,3 +1,23 @@
|
||||
/*
|
||||
* This file is part of libgim.
|
||||
*
|
||||
* libgim is free software: you can redistribute it and/or modify it under the
|
||||
* terms of the GNU General Public License as published by the Free Software
|
||||
* Foundation, either version 3 of the License, or (at your option) any later
|
||||
* version.
|
||||
*
|
||||
* libgim is distributed in the hope that it will be useful, but WITHOUT ANY
|
||||
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
|
||||
* details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with libgim. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* Copyright 2011-2012 Danny Robson <danny@nerdcruft.net>
|
||||
*/
|
||||
|
||||
|
||||
#include "range.hpp"
|
||||
|
||||
#include "debug.hpp"
|
||||
@ -7,15 +27,12 @@
|
||||
#include <cstdint>
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
using namespace std;
|
||||
using namespace util;
|
||||
|
||||
|
||||
/*
|
||||
* Range
|
||||
*/
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
template <typename T>
|
||||
range<T>::range (const json::node &node) {
|
||||
if (node.is_string () && (node == "UNIT" ||
|
||||
@ -170,9 +187,11 @@ const range<T>
|
||||
range<T>::UNIT (0.0, 1.0);
|
||||
|
||||
|
||||
namespace util {
|
||||
template struct range<double>;
|
||||
template struct range<float>;
|
||||
template struct range<uint8_t>;
|
||||
template struct range<uint16_t>;
|
||||
template struct range<uint32_t>;
|
||||
template struct range<uint64_t>;
|
||||
}
|
||||
|
@ -163,6 +163,7 @@ operator<< (std::ostream &os, const region<T> &rhs) {
|
||||
}
|
||||
|
||||
|
||||
namespace util {
|
||||
template struct region<int32_t>;
|
||||
template struct region<int64_t>;
|
||||
template struct region<uint32_t>;
|
||||
@ -171,4 +172,4 @@ template struct region<double>;
|
||||
|
||||
template std::ostream& operator<< (std::ostream&, const region<unsigned int>&);
|
||||
template std::ostream& operator<< (std::ostream&, const region<double>&);
|
||||
|
||||
}
|
||||
|
@ -60,10 +60,11 @@ namespace util {
|
||||
|
||||
void sanity (void) const;
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
template <typename T>
|
||||
std::ostream&
|
||||
operator<< (std::ostream&, const util::region<T>&);
|
||||
std::ostream& operator<< (std::ostream&, const util::region<T>&);
|
||||
}
|
||||
|
||||
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user