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