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:
Davis King 2010-11-18 01:05:28 +00:00
parent 00ee11283e
commit fdb2b7d0e0
2 changed files with 20 additions and 10 deletions

View File

@ -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_

View File

@ -218,6 +218,7 @@ namespace
{
dlog << LINFO << "testing kernel_1a";
rand_test<dlib::rand::kernel_1a>();
rand_test<dlib::rand::float_1a>();
}
} a;