mirror of
https://github.com/NGSolve/netgen.git
synced 2025-01-11 21:50:34 +05:00
dont include archive.hpp, use template function
This commit is contained in:
parent
b4dee312a4
commit
d4c8a94abb
@ -8,7 +8,6 @@
|
||||
/**************************************************************************/
|
||||
|
||||
#include <core/array.hpp>
|
||||
#include <core/archive.hpp>
|
||||
|
||||
namespace netgen
|
||||
{
|
||||
@ -423,8 +422,9 @@ namespace netgen
|
||||
}
|
||||
|
||||
// Only provide this function if T is archivable
|
||||
template<typename T2=T>
|
||||
auto DoArchive(ngcore::Archive& archive) -> typename std::enable_if<ngcore::is_archivable<T2>, void>::type
|
||||
template<typename ARCHIVE>
|
||||
auto DoArchive(ARCHIVE& archive)
|
||||
-> typename std::enable_if_t<ARCHIVE::template is_archivable<T>, void>
|
||||
{
|
||||
if(archive.Output())
|
||||
archive << size;
|
||||
|
@ -7,7 +7,6 @@
|
||||
/* Date: 20. Jul. 02 */
|
||||
/* *************************************************************************/
|
||||
|
||||
#include <core/archive.hpp>
|
||||
#include <core/array.hpp>
|
||||
|
||||
#include <general/ngarray.hpp>
|
||||
@ -72,7 +71,8 @@ namespace netgen
|
||||
|
||||
operator const T* () const { return x; }
|
||||
|
||||
void DoArchive(Archive& archive)
|
||||
template<typename ARCHIVE>
|
||||
void DoArchive(ARCHIVE& archive)
|
||||
{
|
||||
for(int i=0; i<D; i++)
|
||||
archive & x[i];
|
||||
|
@ -7,11 +7,8 @@
|
||||
/* Date: 01. Oct. 94 */
|
||||
/* *************************************************************************/
|
||||
|
||||
#include <core/archive.hpp>
|
||||
|
||||
namespace netgen
|
||||
{
|
||||
using namespace ngcore;
|
||||
|
||||
template <typename T>
|
||||
class TFlatVector
|
||||
@ -142,7 +139,8 @@ public:
|
||||
~Vector ()
|
||||
{ if (ownmem) delete [] data; }
|
||||
|
||||
virtual void DoArchive(Archive& ar)
|
||||
template<typename ARCHIVE>
|
||||
void DoArchive(ARCHIVE& ar)
|
||||
{
|
||||
auto size = s;
|
||||
ar & ownmem & size;
|
||||
|
Loading…
Reference in New Issue
Block a user