Diff
checker
텍스트
텍스트
이미지
문서
Excel
폴더
Legal
Enterprise
데스크톱
요금제
로그인
데스크톱 앱 다운로드
텍스트 비교
두 텍스트 파일의 차이점을 찾아보세요
도구
기록
실시간 편집
변경 없는 행 숨기기
줄바꿈 비활성화
레이아웃
나란히 보기
합쳐 보기
비교 단위
스마트
단어
글자
구문 강조
언어 선택
제외
텍스트 변환
첫 변경으로
수정
Diffchecker Desktop
가장 안전하게 Diffchecker를 사용하는 방법. 데스크톱 앱을 사용하면 비교 데이터가 외부로 전송되지 않습니다!
데스크톱 앱 받기
Untitled diff
생성일
11년 전
비교 결과 만료 없음
초기화
내보내기
공유
설명
43 삭제
행
총
삭제
글자
총
삭제
이 기능을 계속 사용하려면 업그레이드해 주세요
Diff
checker
Pro
요금제 보기
178 행
복사
13 추가
행
총
추가
글자
총
추가
이 기능을 계속 사용하려면 업그레이드해 주세요
Diff
checker
Pro
요금제 보기
146 행
복사
복사
복사됨
복사
복사됨
#ifndef BOOST_SERIALIZATION_
SHARED_PTR_HPP
#ifndef BOOST_SERIALIZATION_
STD_
SHARED_PTR_HPP
#define BOOST_SERIALIZATION_S
HARED_PTR_HPP
#define BOOST_SERIALIZATION_S
TD_S
HARED_PTR_HPP
// MS compatible compilers support #pragma once
// MS compatible compilers support #pragma once
#if defined(_MSC_VER) && (_MSC_VER >= 1020)
#if defined(_MSC_VER) && (_MSC_VER >= 1020)
# pragma once
# pragma once
#endif
#endif
/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
// shared_ptr.hpp: serialization for boost shared pointer
// shared_ptr.hpp: serialization for boost shared pointer
// (C) Copyright 2004 Robert Ramey and Martin Ecker
// (C) Copyright 2004 Robert Ramey and Martin Ecker
// Use, modification and distribution is subject to the Boost Software
// Use, modification and distribution is subject to the Boost Software
// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
// http://www.boost.org/LICENSE_1_0.txt)
// See http://www.boost.org for updates, documentation, and revision history.
// See http://www.boost.org for updates, documentation, and revision history.
#include <cstddef> // NULL
#include <cstddef> // NULL
#include <boost/config.hpp>
#include <boost/config.hpp>
#include <boost/mpl/integral_c.hpp>
#include <boost/mpl/integral_c.hpp>
#include <boost/mpl/integral_c_tag.hpp>
#include <boost/mpl/integral_c_tag.hpp>
#include <boost/detail/workaround.hpp>
#include <boost/detail/workaround.hpp>
복사
복사됨
복사
복사됨
#include <
boost/shared_ptr.hpp
>
#include <
memory
>
#include <boost/serialization/split_free.hpp>
#include <boost/serialization/split_free.hpp>
#include <boost/serialization/nvp.hpp>
#include <boost/serialization/nvp.hpp>
#include <boost/serialization/version.hpp>
#include <boost/serialization/version.hpp>
#include <boost/serialization/tracking.hpp>
#include <boost/serialization/tracking.hpp>
/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
// shared_ptr serialization traits
// shared_ptr serialization traits
// version 1 to distinguish from boost 1.32 version. Note: we can only do this
// version 1 to distinguish from boost 1.32 version. Note: we can only do this
// for a template when the compiler supports partial template specialization
// for a template when the compiler supports partial template specialization
#ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
#ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
namespace boost {
namespace boost {
namespace serialization{
namespace serialization{
template<class T>
template<class T>
복사
복사됨
복사
복사됨
struct version< ::
boost
::shared_ptr< T > > {
struct version< ::
std
::shared_ptr< T > > {
typedef mpl::integral_c_tag tag;
typedef mpl::integral_c_tag tag;
#if BOOST_WORKAROUND(__MWERKS__, BOOST_TESTED_AT(0x3206))
#if BOOST_WORKAROUND(__MWERKS__, BOOST_TESTED_AT(0x3206))
typedef BOOST_DEDUCED_TYPENAME mpl::int_<1> type;
typedef BOOST_DEDUCED_TYPENAME mpl::int_<1> type;
#else
#else
typedef mpl::int_<1> type;
typedef mpl::int_<1> type;
#endif
#endif
#if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x570))
#if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x570))
BOOST_STATIC_CONSTANT(int, value = 1);
BOOST_STATIC_CONSTANT(int, value = 1);
#else
#else
BOOST_STATIC_CONSTANT(int, value = type::value);
BOOST_STATIC_CONSTANT(int, value = type::value);
#endif
#endif
};
};
// don't track shared pointers
// don't track shared pointers
template<class T>
template<class T>
복사
복사됨
복사
복사됨
struct tracking_level< ::
boost
::shared_ptr< T > > {
struct tracking_level< ::
std
::shared_ptr< T > > {
typedef mpl::integral_c_tag tag;
typedef mpl::integral_c_tag tag;
#if BOOST_WORKAROUND(__MWERKS__, BOOST_TESTED_AT(0x3206))
#if BOOST_WORKAROUND(__MWERKS__, BOOST_TESTED_AT(0x3206))
typedef BOOST_DEDUCED_TYPENAME mpl::int_< ::boost::serialization::track_never> type;
typedef BOOST_DEDUCED_TYPENAME mpl::int_< ::boost::serialization::track_never> type;
#else
#else
typedef mpl::int_< ::boost::serialization::track_never> type;
typedef mpl::int_< ::boost::serialization::track_never> type;
#endif
#endif
#if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x570))
#if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x570))
BOOST_STATIC_CONSTANT(int, value = ::boost::serialization::track_never);
BOOST_STATIC_CONSTANT(int, value = ::boost::serialization::track_never);
#else
#else
BOOST_STATIC_CONSTANT(int, value = type::value);
BOOST_STATIC_CONSTANT(int, value = type::value);
#endif
#endif
};
};
}}
}}
#define BOOST_SERIALIZATION_SHARED_PTR(T)
#define BOOST_SERIALIZATION_SHARED_PTR(T)
#else
#else
// define macro to let users of these compilers do this
// define macro to let users of these compilers do this
#define BOOST_SERIALIZATION_SHARED_PTR(T) \
#define BOOST_SERIALIZATION_SHARED_PTR(T) \
BOOST_CLASS_VERSION( \
BOOST_CLASS_VERSION( \
복사
복사됨
복사
복사됨
::
boost
::shared_ptr< T >, \
::
std
::shared_ptr< T >, \
1 \
1 \
) \
) \
BOOST_CLASS_TRACKING( \
BOOST_CLASS_TRACKING( \
복사
복사됨
복사
복사됨
::
boost
::shared_ptr< T >, \
::
std
::shared_ptr< T >, \
::boost::serialization::track_never \
::boost::serialization::track_never \
) \
) \
/**/
/**/
#endif
#endif
namespace boost {
namespace boost {
namespace serialization{
namespace serialization{
복사
복사됨
복사
복사됨
#ifndef BOOST_SERIALIZATION_SHARED_PTR_HPP
struct null_deleter {
struct null_deleter {
void operator()(void const *) const {}
void operator()(void const *) const {}
};
};
복사
복사됨
복사
복사됨
#endif
/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
// serialization for shared_ptr
// serialization for shared_ptr
template<class Archive, class T>
template<class Archive, class T>
inline void save(
inline void save(
Archive & ar,
Archive & ar,
복사
복사됨
복사
복사됨
const
boost
::shared_ptr< T > &t,
const
std
::shared_ptr< T > &t,
const unsigned int /* file_version */
const unsigned int /* file_version */
){
){
// The most common cause of trapping here would be serializing
// The most common cause of trapping here would be serializing
// something like shared_ptr<int>. This occurs because int
// something like shared_ptr<int>. This occurs because int
// is never tracked by default. Wrap int in a trackable type
// is never tracked by default. Wrap int in a trackable type
BOOST_STATIC_ASSERT((tracking_level< T >::value != track_never));
BOOST_STATIC_ASSERT((tracking_level< T >::value != track_never));
const T * t_ptr = t.get();
const T * t_ptr = t.get();
ar << boost::serialization::make_nvp("px", t_ptr);
ar << boost::serialization::make_nvp("px", t_ptr);
}
}
복사
복사됨
복사
복사됨
#ifdef BOOST_SERIALIZATION_SHARED_PTR_132_HPP
template<class Archive, class T>
inline void load(
Archive & ar,
boost::shared_ptr< T > &t,
const unsigned int file_version
){
// The most common cause of trapping here would be serializing
// something like shared_ptr<int>. This occurs because int
// is never tracked by default. Wrap int in a trackable type
BOOST_STATIC_ASSERT((tracking_level< T >::value != track_never));
T* r;
if(file_version < 1){
//ar.register_type(static_cast<
// boost_132::detail::sp_counted_base_impl<T *, boost::checked_deleter< T > > *
//>(NULL));
ar.register_type(static_cast<
boost_132::detail::sp_counted_base_impl<T *, null_deleter > *
>(NULL));
boost_132::shared_ptr< T > sp;
ar >> boost::serialization::make_nvp("px", sp.px);
ar >> boost::serialization::make_nvp("pn", sp.pn);
// got to keep the sps around so the sp.pns don't disappear
ar.append(sp);
r = sp.get();
}
else{
ar >> boost::serialization::make_nvp("px", r);
}
ar.reset(t,r);
}
#else
template<class Archive, class T>
template<class Archive, class T>
inline void load(
inline void load(
Archive & ar,
Archive & ar,
복사
복사됨
복사
복사됨
boost
::shared_ptr< T > &t,
std
::shared_ptr< T > &t,
const unsigned int /*file_version*/
const unsigned int /*file_version*/
){
){
// The most common cause of trapping here would be serializing
// The most common cause of trapping here would be serializing
// something like shared_ptr<int>. This occurs because int
// something like shared_ptr<int>. This occurs because int
// is never tracked by default. Wrap int in a trackable type
// is never tracked by default. Wrap int in a trackable type
BOOST_STATIC_ASSERT((tracking_level< T >::value != track_never));
BOOST_STATIC_ASSERT((tracking_level< T >::value != track_never));
T* r;
T* r;
ar >> boost::serialization::make_nvp("px", r);
ar >> boost::serialization::make_nvp("px", r);
ar.reset(t,r);
ar.reset(t,r);
}
}
복사
복사됨
복사
복사됨
#endif
template<class Archive, class T>
template<class Archive, class T>
inline void serialize(
inline void serialize(
Archive & ar,
Archive & ar,
복사
복사됨
복사
복사됨
boost
::shared_ptr< T > &t,
std
::shared_ptr< T > &t,
const unsigned int file_version
const unsigned int file_version
){
){
// correct shared_ptr serialization depends upon object tracking
// correct shared_ptr serialization depends upon object tracking
// being used.
// being used.
BOOST_STATIC_ASSERT(
BOOST_STATIC_ASSERT(
boost::serialization::tracking_level< T >::value
boost::serialization::tracking_level< T >::value
!= boost::serialization::track_never
!= boost::serialization::track_never
);
);
boost::serialization::split_free(ar, t, file_version);
boost::serialization::split_free(ar, t, file_version);
}
}
} // namespace serialization
} // namespace serialization
} // namespace boost
} // namespace boost
복사
복사됨
복사
복사됨
#endif // BOOST_SERIALIZATION_
SHARED_PTR_HPP
#endif // BOOST_SERIALIZATION_
STD_
SHARED_PTR_HPP
저장된 비교 결과
원본
파일 열기
#ifndef BOOST_SERIALIZATION_SHARED_PTR_HPP #define BOOST_SERIALIZATION_SHARED_PTR_HPP // MS compatible compilers support #pragma once #if defined(_MSC_VER) && (_MSC_VER >= 1020) # pragma once #endif /////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 // shared_ptr.hpp: serialization for boost shared pointer // (C) Copyright 2004 Robert Ramey and Martin Ecker // Use, modification and distribution is subject to the Boost Software // License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) // See http://www.boost.org for updates, documentation, and revision history. #include <cstddef> // NULL #include <boost/config.hpp> #include <boost/mpl/integral_c.hpp> #include <boost/mpl/integral_c_tag.hpp> #include <boost/detail/workaround.hpp> #include <boost/shared_ptr.hpp> #include <boost/serialization/split_free.hpp> #include <boost/serialization/nvp.hpp> #include <boost/serialization/version.hpp> #include <boost/serialization/tracking.hpp> /////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 // shared_ptr serialization traits // version 1 to distinguish from boost 1.32 version. Note: we can only do this // for a template when the compiler supports partial template specialization #ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION namespace boost { namespace serialization{ template<class T> struct version< ::boost::shared_ptr< T > > { typedef mpl::integral_c_tag tag; #if BOOST_WORKAROUND(__MWERKS__, BOOST_TESTED_AT(0x3206)) typedef BOOST_DEDUCED_TYPENAME mpl::int_<1> type; #else typedef mpl::int_<1> type; #endif #if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x570)) BOOST_STATIC_CONSTANT(int, value = 1); #else BOOST_STATIC_CONSTANT(int, value = type::value); #endif }; // don't track shared pointers template<class T> struct tracking_level< ::boost::shared_ptr< T > > { typedef mpl::integral_c_tag tag; #if BOOST_WORKAROUND(__MWERKS__, BOOST_TESTED_AT(0x3206)) typedef BOOST_DEDUCED_TYPENAME mpl::int_< ::boost::serialization::track_never> type; #else typedef mpl::int_< ::boost::serialization::track_never> type; #endif #if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x570)) BOOST_STATIC_CONSTANT(int, value = ::boost::serialization::track_never); #else BOOST_STATIC_CONSTANT(int, value = type::value); #endif }; }} #define BOOST_SERIALIZATION_SHARED_PTR(T) #else // define macro to let users of these compilers do this #define BOOST_SERIALIZATION_SHARED_PTR(T) \ BOOST_CLASS_VERSION( \ ::boost::shared_ptr< T >, \ 1 \ ) \ BOOST_CLASS_TRACKING( \ ::boost::shared_ptr< T >, \ ::boost::serialization::track_never \ ) \ /**/ #endif namespace boost { namespace serialization{ struct null_deleter { void operator()(void const *) const {} }; /////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 // serialization for shared_ptr template<class Archive, class T> inline void save( Archive & ar, const boost::shared_ptr< T > &t, const unsigned int /* file_version */ ){ // The most common cause of trapping here would be serializing // something like shared_ptr<int>. This occurs because int // is never tracked by default. Wrap int in a trackable type BOOST_STATIC_ASSERT((tracking_level< T >::value != track_never)); const T * t_ptr = t.get(); ar << boost::serialization::make_nvp("px", t_ptr); } #ifdef BOOST_SERIALIZATION_SHARED_PTR_132_HPP template<class Archive, class T> inline void load( Archive & ar, boost::shared_ptr< T > &t, const unsigned int file_version ){ // The most common cause of trapping here would be serializing // something like shared_ptr<int>. This occurs because int // is never tracked by default. Wrap int in a trackable type BOOST_STATIC_ASSERT((tracking_level< T >::value != track_never)); T* r; if(file_version < 1){ //ar.register_type(static_cast< // boost_132::detail::sp_counted_base_impl<T *, boost::checked_deleter< T > > * //>(NULL)); ar.register_type(static_cast< boost_132::detail::sp_counted_base_impl<T *, null_deleter > * >(NULL)); boost_132::shared_ptr< T > sp; ar >> boost::serialization::make_nvp("px", sp.px); ar >> boost::serialization::make_nvp("pn", sp.pn); // got to keep the sps around so the sp.pns don't disappear ar.append(sp); r = sp.get(); } else{ ar >> boost::serialization::make_nvp("px", r); } ar.reset(t,r); } #else template<class Archive, class T> inline void load( Archive & ar, boost::shared_ptr< T > &t, const unsigned int /*file_version*/ ){ // The most common cause of trapping here would be serializing // something like shared_ptr<int>. This occurs because int // is never tracked by default. Wrap int in a trackable type BOOST_STATIC_ASSERT((tracking_level< T >::value != track_never)); T* r; ar >> boost::serialization::make_nvp("px", r); ar.reset(t,r); } #endif template<class Archive, class T> inline void serialize( Archive & ar, boost::shared_ptr< T > &t, const unsigned int file_version ){ // correct shared_ptr serialization depends upon object tracking // being used. BOOST_STATIC_ASSERT( boost::serialization::tracking_level< T >::value != boost::serialization::track_never ); boost::serialization::split_free(ar, t, file_version); } } // namespace serialization } // namespace boost #endif // BOOST_SERIALIZATION_SHARED_PTR_HPP
수정본
파일 열기
#ifndef BOOST_SERIALIZATION_STD_SHARED_PTR_HPP #define BOOST_SERIALIZATION_STD_SHARED_PTR_HPP // MS compatible compilers support #pragma once #if defined(_MSC_VER) && (_MSC_VER >= 1020) # pragma once #endif /////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 // shared_ptr.hpp: serialization for boost shared pointer // (C) Copyright 2004 Robert Ramey and Martin Ecker // Use, modification and distribution is subject to the Boost Software // License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) // See http://www.boost.org for updates, documentation, and revision history. #include <cstddef> // NULL #include <boost/config.hpp> #include <boost/mpl/integral_c.hpp> #include <boost/mpl/integral_c_tag.hpp> #include <boost/detail/workaround.hpp> #include <memory> #include <boost/serialization/split_free.hpp> #include <boost/serialization/nvp.hpp> #include <boost/serialization/version.hpp> #include <boost/serialization/tracking.hpp> /////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 // shared_ptr serialization traits // version 1 to distinguish from boost 1.32 version. Note: we can only do this // for a template when the compiler supports partial template specialization #ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION namespace boost { namespace serialization{ template<class T> struct version< ::std::shared_ptr< T > > { typedef mpl::integral_c_tag tag; #if BOOST_WORKAROUND(__MWERKS__, BOOST_TESTED_AT(0x3206)) typedef BOOST_DEDUCED_TYPENAME mpl::int_<1> type; #else typedef mpl::int_<1> type; #endif #if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x570)) BOOST_STATIC_CONSTANT(int, value = 1); #else BOOST_STATIC_CONSTANT(int, value = type::value); #endif }; // don't track shared pointers template<class T> struct tracking_level< ::std::shared_ptr< T > > { typedef mpl::integral_c_tag tag; #if BOOST_WORKAROUND(__MWERKS__, BOOST_TESTED_AT(0x3206)) typedef BOOST_DEDUCED_TYPENAME mpl::int_< ::boost::serialization::track_never> type; #else typedef mpl::int_< ::boost::serialization::track_never> type; #endif #if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x570)) BOOST_STATIC_CONSTANT(int, value = ::boost::serialization::track_never); #else BOOST_STATIC_CONSTANT(int, value = type::value); #endif }; }} #define BOOST_SERIALIZATION_SHARED_PTR(T) #else // define macro to let users of these compilers do this #define BOOST_SERIALIZATION_SHARED_PTR(T) \ BOOST_CLASS_VERSION( \ ::std::shared_ptr< T >, \ 1 \ ) \ BOOST_CLASS_TRACKING( \ ::std::shared_ptr< T >, \ ::boost::serialization::track_never \ ) \ /**/ #endif namespace boost { namespace serialization{ #ifndef BOOST_SERIALIZATION_SHARED_PTR_HPP struct null_deleter { void operator()(void const *) const {} }; #endif /////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 // serialization for shared_ptr template<class Archive, class T> inline void save( Archive & ar, const std::shared_ptr< T > &t, const unsigned int /* file_version */ ){ // The most common cause of trapping here would be serializing // something like shared_ptr<int>. This occurs because int // is never tracked by default. Wrap int in a trackable type BOOST_STATIC_ASSERT((tracking_level< T >::value != track_never)); const T * t_ptr = t.get(); ar << boost::serialization::make_nvp("px", t_ptr); } template<class Archive, class T> inline void load( Archive & ar, std::shared_ptr< T > &t, const unsigned int /*file_version*/ ){ // The most common cause of trapping here would be serializing // something like shared_ptr<int>. This occurs because int // is never tracked by default. Wrap int in a trackable type BOOST_STATIC_ASSERT((tracking_level< T >::value != track_never)); T* r; ar >> boost::serialization::make_nvp("px", r); ar.reset(t,r); } template<class Archive, class T> inline void serialize( Archive & ar, std::shared_ptr< T > &t, const unsigned int file_version ){ // correct shared_ptr serialization depends upon object tracking // being used. BOOST_STATIC_ASSERT( boost::serialization::tracking_level< T >::value != boost::serialization::track_never ); boost::serialization::split_free(ar, t, file_version); } } // namespace serialization } // namespace boost #endif // BOOST_SERIALIZATION_STD_SHARED_PTR_HPP
비교하기