From 38876049c9f1164d2dab5b33d3932eee304dd939 Mon Sep 17 00:00:00 2001 From: molpopogen Date: Wed, 7 Jul 2021 13:57:19 -0700 Subject: [PATCH] optional should wrap a reference_wrapper --- fwdpp/ts/types/tree_sequence.hpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/fwdpp/ts/types/tree_sequence.hpp b/fwdpp/ts/types/tree_sequence.hpp index 475fc9548..6eeebca71 100644 --- a/fwdpp/ts/types/tree_sequence.hpp +++ b/fwdpp/ts/types/tree_sequence.hpp @@ -43,11 +43,12 @@ namespace fwdpp } #if __cplusplus >= 201703L - std::optional&> + std::optional>> tree() const { // FIXME: should be nullopt if no more trees - return std::optional&>{ + return std::optional< + std::reference_wrapper>>{ std::cref(tree_)}; } #endif