Menu

const modifier for relational operators

Andy Panov
2004-02-07
2012-09-15
  • Andy Panov

    Andy Panov - 2004-02-07

    Hello,

    I would be nice to implement a relational operators (such as >, < >=, etc.) of Vec class  as a constant member functions since they does not change the object state:

    Vec<bin> operator<(const Num_T value) const

    instead of existing

    Vec<bin> operator<(const Num_T value)

    It would allow to get rid of following ugly const_casts:

    void decode(const ivec& soft_input){
      ....
      bvec hard_input = (const_cast<ivec&> (soft_input) <=0);
    ...
    }

    Best Regards.
    Andy. P.

     
    • Tony Ottosson Gadd

      This will be fixed in next version of IT++ to be released within a few weeks.

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.