Skip to content

Commit 9f5b9cc

Browse files
Fix regression tests.
1 parent c51c1c2 commit 9f5b9cc

File tree

4 files changed

+34
-8
lines changed

4 files changed

+34
-8
lines changed

Diff for: pack_base.h

+26-6
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
#ifndef PACK_BASE_H
1414
#define PACK_BASE_H
1515
#include "classdesc.h"
16+
#include "function.h"
17+
1618
#include <stdio.h>
1719
#include <stdlib.h>
1820
#include <string.h>
@@ -701,6 +703,26 @@ namespace classdesc
701703
void unpack(pack_t& targ, const string& desc, R (C::*&arg)(A1))
702704
{targ.unpackraw((char*)&arg,sizeof(arg));}
703705

706+
template<class C, class T>
707+
typename enable_if<And<is_member_object_pointer<T>,
708+
Not<functional::is_nonmember_function_ptr<T> > >,void>::T
709+
pack(pack_t& b, const string& d, C& o, T y);
710+
template<class C, class T>
711+
typename enable_if<And<is_member_object_pointer<T>,
712+
Not<functional::is_nonmember_function_ptr<T> > >,void>::T
713+
unpack(unpack_t& b, const string& d, C& o, T y);
714+
715+
template<class C, class T>
716+
typename enable_if<
717+
And<Not<is_base_of<is_const_static,C> >,
718+
is_object<T> >,void>::T
719+
pack(pack_t& b, const string& d, C&, T* y);
720+
template<class C, class T>
721+
typename enable_if<
722+
And<Not<is_base_of<is_const_static,C> >,
723+
is_object<T> >,void>::T
724+
unpack(unpack_t& b, const string& d, C&, T* y);
725+
704726
/// const static support. No need to stream
705727
template <class T>
706728
void pack(pack_t& targ, const string& desc, is_const_static i, T t)
@@ -735,17 +757,15 @@ namespace classdesc
735757

736758
}
737759

760+
#include "use_mbr_pointers.h"
761+
CLASSDESC_FUNCTION_NOP(pack)
762+
CLASSDESC_FUNCTION_NOP(unpack)
763+
738764
using classdesc::pack;
739765
using classdesc::unpack;
740766
using classdesc::pack_onbase;
741767
using classdesc::unpack_onbase;
742768

743-
#include "use_mbr_pointers.h"
744-
CLASSDESC_USE_OLDSTYLE_MEMBER_OBJECTS(pack)
745-
CLASSDESC_USE_OLDSTYLE_MEMBER_OBJECTS(unpack)
746-
CLASSDESC_FUNCTION_NOP(pack)
747-
CLASSDESC_FUNCTION_NOP(unpack)
748-
749769
#ifdef _CLASSDESC
750770
#pragma omit pack classdesc::string
751771
#pragma omit pack eco_strstream

Diff for: pack_epilogue.h

+4
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@
1111

1212
#include "pack_stl.h"
1313

14+
#include "use_mbr_pointers.h"
15+
CLASSDESC_USE_OLDSTYLE_MEMBER_OBJECTS(pack)
16+
CLASSDESC_USE_OLDSTYLE_MEMBER_OBJECTS(unpack)
17+
1418
namespace classdesc_access
1519
{
1620
namespace cd=classdesc;

Diff for: test/c++11/c++Features.cc

+1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ namespace std
1616
};
1717
}
1818

19+
#include "pack_stl.h"
1920
#include "c++Features.h"
2021
#include "classdesc_epilogue.h"
2122

Diff for: use_mbr_pointers.h

+3-2
Original file line numberDiff line numberDiff line change
@@ -13,20 +13,21 @@
1313
#include "function.h"
1414

1515
#define CLASSDESC_USE_OLDSTYLE_MEMBER_OBJECTS(descriptor) \
16+
using classdesc::descriptor; \
1617
namespace classdesc { \
1718
template<class C, class T> \
1819
typename enable_if<And<is_member_object_pointer<T>, \
1920
Not<functional::is_nonmember_function_ptr<T> > >,void>::T \
2021
descriptor(descriptor##_t& b, const string& d, C& o, T y) \
21-
{descriptor(b,d,o.*y);} \
22+
{::descriptor(b,d,o.*y);} \
2223
\
2324
/* for static object members */ \
2425
template<class C, class T> \
2526
typename enable_if< \
2627
And<Not<is_base_of<is_const_static,C> >, \
2728
is_object<T> >,void>::T \
2829
descriptor(descriptor##_t& b, const string& d, C&, T* y) \
29-
{descriptor(b,d,*y);} \
30+
{::descriptor(b,d,*y);} \
3031
}
3132

3233
// do nothing for function objects - suitable for all serialisation descriptors

0 commit comments

Comments
 (0)