mirror of https://github.com/davisking/dlib.git
Moved serialize definition outside class since some compilers will fail to compile
friend functions when they aren't declared in this way. --HG-- extra : convert_revision : svn%3Afdd8eb12-d10e-0410-9acb-85c331704f74/trunk%403908
This commit is contained in:
parent
00ee11283e
commit
fdb2b7d0e0
|
@ -114,20 +114,12 @@ namespace dlib
|
|||
friend void serialize(
|
||||
const rand_kernel_1& item,
|
||||
std::ostream& out
|
||||
)
|
||||
{
|
||||
serialize(item.mt, out);
|
||||
serialize(item.seed, out);
|
||||
}
|
||||
);
|
||||
|
||||
friend void deserialize(
|
||||
rand_kernel_1& item,
|
||||
std::istream& in
|
||||
)
|
||||
{
|
||||
deserialize(item.mt, in);
|
||||
deserialize(item.seed, in);
|
||||
}
|
||||
);
|
||||
|
||||
private:
|
||||
mt19937 mt;
|
||||
|
@ -148,6 +140,23 @@ namespace dlib
|
|||
static const bool value = true;
|
||||
};
|
||||
|
||||
inline void serialize(
|
||||
const rand_kernel_1& item,
|
||||
std::ostream& out
|
||||
)
|
||||
{
|
||||
serialize(item.mt, out);
|
||||
serialize(item.seed, out);
|
||||
}
|
||||
|
||||
inline void deserialize(
|
||||
rand_kernel_1& item,
|
||||
std::istream& in
|
||||
)
|
||||
{
|
||||
deserialize(item.mt, in);
|
||||
deserialize(item.seed, in);
|
||||
}
|
||||
}
|
||||
|
||||
#endif // DLIB_RAND_KERNEl_1_
|
||||
|
|
|
@ -218,6 +218,7 @@ namespace
|
|||
{
|
||||
dlog << LINFO << "testing kernel_1a";
|
||||
rand_test<dlib::rand::kernel_1a>();
|
||||
rand_test<dlib::rand::float_1a>();
|
||||
}
|
||||
} a;
|
||||
|
||||
|
|
Loading…
Reference in New Issue