Skip to content

Commit

Permalink
Merge pull request #366 from headupinclouds/pr.is_loading.is_saving
Browse files Browse the repository at this point in the history
Add is_loading and is_saving values to cereal::{Input,Output}Archive
  • Loading branch information
AzothAmmo authored Nov 28, 2016
2 parents 1edc5c6 + 6e71766 commit 9978e0c
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions include/cereal/cereal.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,20 @@ namespace cereal
a large project from Boost to cereal. The preferred interface for cereal is using operator(). */
//! @{

//! Indicates this archive is not intended for loading
/*! This ensures compatibility with boost archive types. If you are transitioning
from boost, you can check this value within a member or external serialize function
(i.e., Archive::is_loading::value) to disable behavior specific to loading, until
you can transition to split save/load or save_minimal/load_minimal functions */
using is_loading = std::false_type;

//! Indicates this archive is intended for saving
/*! This ensures compatibility with boost archive types. If you are transitioning
from boost, you can check this value within a member or external serialize function
(i.e., Archive::is_saving::value) to enable behavior specific to loading, until
you can transition to split save/load or save_minimal/load_minimal functions */
using is_saving = std::true_type;

//! Serializes passed in data
/*! This is a boost compatability layer and is not the preferred way of using
cereal. If you are transitioning from boost, use this until you can
Expand Down Expand Up @@ -611,6 +625,20 @@ namespace cereal
a large project from Boost to cereal. The preferred interface for cereal is using operator(). */
//! @{

//! Indicates this archive is intended for loading
/*! This ensures compatibility with boost archive types. If you are transitioning
from boost, you can check this value within a member or external serialize function
(i.e., Archive::is_loading::value) to enable behavior specific to loading, until
you can transition to split save/load or save_minimal/load_minimal functions */
using is_loading = std::true_type;

//! Indicates this archive is not intended for saving
/*! This ensures compatibility with boost archive types. If you are transitioning
from boost, you can check this value within a member or external serialize function
(i.e., Archive::is_saving::value) to disable behavior specific to loading, until
you can transition to split save/load or save_minimal/load_minimal functions */
using is_saving = std::false_type;

//! Serializes passed in data
/*! This is a boost compatability layer and is not the preferred way of using
cereal. If you are transitioning from boost, use this until you can
Expand Down

0 comments on commit 9978e0c

Please sign in to comment.