diff --git a/python/src/section/1/451.python.cpp b/python/src/section/1/451.python.cpp index 10f1b08f..1143b529 100644 --- a/python/src/section/1/451.python.cpp +++ b/python/src/section/1/451.python.cpp @@ -292,8 +292,7 @@ void wrapSection_1_451( python::module& module, python::module& viewmodule ) { .def_property_readonly( "description", - [] ( const Section& type ) -> std::string - { return ranges::to< std::string >( type.description() ); }, + &Section::description, "The descriptive information" ) .def_property_readonly( diff --git a/src/ENDFtk/section/1/451.hpp b/src/ENDFtk/section/1/451.hpp index e1b4c5af..2b62b3a2 100644 --- a/src/ENDFtk/section/1/451.hpp +++ b/src/ENDFtk/section/1/451.hpp @@ -7,11 +7,7 @@ #include "range/v3/iterator/operations.hpp" #include "range/v3/range/conversion.hpp" #include "range/v3/view/all.hpp" -#include "range/v3/view/concat.hpp" -#include "range/v3/view/join.hpp" -#include "range/v3/view/single.hpp" #include "range/v3/view/split.hpp" -#include "range/v3/view/transform.hpp" #include "ENDFtk/macros.hpp" #include "ENDFtk/TextRecord.hpp" #include "ENDFtk/HeadRecord.hpp" @@ -31,7 +27,7 @@ namespace section { * See ENDF102, section 1.1 for more information. */ template<> - class ENDFTK_PYTHON_EXPORT Type< 1, 451 > : + class ENDFTK_PYTHON_EXPORT Type< 1, 451 > : protected BaseWithoutMT< Type< 1, 451 > > { friend BaseWithoutMT< Type< 1, 451 > >; diff --git a/src/ENDFtk/section/1/451/src/description.hpp b/src/ENDFtk/section/1/451/src/description.hpp index e1052662..d5ba2bef 100644 --- a/src/ENDFtk/section/1/451/src/description.hpp +++ b/src/ENDFtk/section/1/451/src/description.hpp @@ -3,12 +3,11 @@ */ auto description() const { - return - ranges::views::concat - ( this->description_ - | ranges::cpp20::views::transform - ( []( const auto& textRecord )->decltype(auto) - { return textRecord.text(); } ) - | ranges::views::join( '\n' ), - ranges::cpp20::views::single( '\n' ) ); + std::string description; + for ( auto&& record : this->description_ ) { + + description += record.text(); + description += '\n'; + } + return description; } diff --git a/src/ENDFtk/section/1/451/src/makeDescription.hpp b/src/ENDFtk/section/1/451/src/makeDescription.hpp index 568b30d6..a502e2a2 100644 --- a/src/ENDFtk/section/1/451/src/makeDescription.hpp +++ b/src/ENDFtk/section/1/451/src/makeDescription.hpp @@ -2,10 +2,16 @@ static std::vector< TextRecord > makeDescription( const std::string& description ) { - return ranges::to< std::vector< TextRecord > >( - ranges::cpp20::views::split( description, '\n' ) - | ranges::cpp20::views::transform( - [] ( const auto& line ) - { std::string string = ranges::to< std::string >( line ); - return TextRecord( std::move( string ) ); } ) ); + std::vector< TextRecord > result; + auto begin = description.begin(); + auto iter = std::find_if( begin, description.end(), + [] ( auto&& character ) { return character == '\n'; } ); + while ( begin != description.end() ) { + + result.emplace_back( std::string( begin, iter ) ); + begin = iter + 1; + iter = std::find_if( begin, description.end(), + [] ( auto&& character ) { return character == '\n'; } ); + } + return result; }