<commit_before>// @(#)root/reflex:$Id$
// Author: <NAME> 2006

// Copyright CERN, CH-1211 Geneva 23, 2004-2006, All rights reserved.
//
// Permission to use, copy, modify, and distribute this software for any
// purpose is hereby granted without fee, provided that this copyright and
// permissions notice appear in all copies and derivatives.
//
// This software is provided "as is" without express or implied warranty.


// Include Files

#ifndef Reflex_InternalTools
#define Reflex_InternalTools

namespace Reflex {

   namespace OTools {

      template< typename TO > class ToIter {

      public:

         template < typename CONT > 
         static typename std::vector<TO>::iterator Begin( const CONT & cont ) {
            if ( ! cont.size()) return End<CONT>(cont);
            else                return typename std::vector<TO>::iterator((TO*)&cont[0]);
         }

         template < typename CONT >
         static typename std::vector<TO>::iterator End( const CONT & cont ) {
            typename std::vector<TO>::iterator it = typename std::vector<TO>::iterator((TO*)&cont[cont.size()-1]);
            return it++;
         }

         template < typename CONT > 
         static typename std::vector<TO>::const_reverse_iterator RBegin( const CONT & cont ) {
            if ( ! cont.size()) return REnd<CONT>(cont);
            else                return typename std::vector<TO>::const_reverse_iterator(typename std::vector<TO>::iterator((TO*)&cont[cont.size()-1]));
         }

         template < typename CONT >
         static typename std::vector<TO>::const_reverse_iterator REnd( const CONT & cont ) {
            typename std::vector<TO>::iterator it = typename std::vector<TO>::iterator((TO*)&cont[0]);
            return typename std::vector<TO>::const_reverse_iterator(it--);
         }

      };

   } // namespace OTools
} // namespace Reflex

#endif // Reflex_InternalTools<commit_msg>Second try to fix the ugly cast of iter<A> to iter<B>. Just hard cast the container...<commit_after>// @(#)root/reflex:$Id$
// Author: <NAME> 2006

// Copyright CERN, CH-1211 <NAME>, 2004-2006, All rights reserved.
//
// Permission to use, copy, modify, and distribute this software for any
// purpose is hereby granted without fee, provided that this copyright and
// permissions notice appear in all copies and derivatives.
//
// This software is provided "as is" without express or implied warranty.


// Include Files

#ifndef Reflex_InternalTools
#define Reflex_InternalTools

namespace Reflex {

   namespace OTools {

      template< typename TO > class ToIter {

      public:

         template < typename CONT > 
         static typename std::vector<TO>::iterator Begin( const CONT & cont ) {
            return ((typename std::vector<TO> &)const_cast<CONT &>(cont)).begin();
         }

         template < typename CONT >
         static typename std::vector<TO>::iterator End( const CONT & cont ) {
            return ((typename std::vector<TO> &)const_cast<CONT &>(cont)).end();
         }

         template < typename CONT > 
         static typename std::vector<TO>::const_reverse_iterator RBegin( const CONT & cont ) {
            return ((typename std::vector<TO> &)cont).rbegin();
         }

         template < typename CONT >
         static typename std::vector<TO>::const_reverse_iterator REnd( const CONT & cont ) {
            return ((typename std::vector<TO> &)cont).rend();
         }

      };

   } // namespace OTools
} // namespace Reflex

#endif // Reflex_InternalTools
{'fraction_non_alphanumeric': 0.12382845782448168, 'fraction_numerical': 0.010792388525986936, 'mean_word_length': 2.742826780021254, 'pattern_counts': {'":': 0, '<': 42, '<?xml version=': 0, '>': 42, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3946694', 'n_tokens_mistral': 1014, 'n_tokens_neox': 905, 'n_words': 297}