diff --git a/lemon/path.h b/lemon/path.h --- a/lemon/path.h +++ b/lemon/path.h @@ -929,9 +929,8 @@ }; template ::value, - bool revEnable = RevPathTagIndicator::value> - struct PathCopySelector { + bool buildEnable = BuildTagIndicator::value> + struct PathCopySelectorForward { static void copy(Target& target, const Source& source) { target.clear(); for (typename Source::ArcIt it(source); it != INVALID; ++it) { @@ -941,7 +940,16 @@ }; template - struct PathCopySelector { + struct PathCopySelectorForward { + static void copy(Target& target, const Source& source) { + target.clear(); + target.build(source); + } + }; + + template ::value> + struct PathCopySelectorBackward { static void copy(Target& target, const Source& source) { target.clear(); for (typename Source::RevArcIt it(source); it != INVALID; ++it) { @@ -951,21 +959,29 @@ }; template - struct PathCopySelector { - static void copy(Target& target, const Source& source) { - target.clear(); - target.build(source); - } - }; - - template - struct PathCopySelector { + struct PathCopySelectorBackward { static void copy(Target& target, const Source& source) { target.clear(); target.buildRev(source); } }; + + template ::value> + struct PathCopySelector { + static void copy(Target& target, const Source& source) { + PathCopySelectorForward::copy(target, source); + } + }; + + template + struct PathCopySelector { + static void copy(Target& target, const Source& source) { + PathCopySelectorBackward::copy(target, source); + } + }; + }