1 #ifndef GENESIS_TAXONOMY_ITERATOR_LEVELORDER_H_
2 #define GENESIS_TAXONOMY_ITERATOR_LEVELORDER_H_
60 std::function<
void(
Taxon& )> fn,
61 bool include_inner_taxa =
true
63 std::queue< Taxon* > taxa_queue;
64 for(
auto& t : tax ) {
65 taxa_queue.push( &t );
68 while( ! taxa_queue.empty() ) {
69 auto& cur = *taxa_queue.front();
71 if( include_inner_taxa || cur.size() == 0 ) {
75 for(
auto& t : cur ) {
76 taxa_queue.push( &t );
94 std::function<
void(
Taxon const& )> fn,
95 bool include_inner_taxa =
true
97 std::queue< Taxon const* > taxa_queue;
98 for(
auto& t : tax ) {
99 taxa_queue.push( &t );
102 while( ! taxa_queue.empty() ) {
103 auto const& cur = *taxa_queue.front();
105 if( include_inner_taxa || cur.size() == 0 ) {
109 for(
auto const& t : cur ) {
110 taxa_queue.push( &t );
119 #endif // include guard