id,summary,reporter,owner,description,type,status,milestone,component,version,severity,resolution,keywords,cc 12363,int_adapter is_signed should be const,James E. King III ,"James E. King, III","In int_adapter at lines 171 to 183, with coverity comments: {{{ 171 bool operator<(const int& rhs) const 172 { 173 // quiets compiler warnings assignment: Assigning: is_signed = true. 174 bool is_signed = std::numeric_limits::is_signed; const: At condition is_signed, the value of is_signed must be equal to 1. dead_error_condition: The condition !is_signed cannot be true. 175 if(!is_signed) 176 { CID 10153 (#1 of 1): 'Constant' variable guards dead code (DEADCODE)dead_error_line: Execution cannot reach this statement: if (boost::date_time::int_a.... Local variable is_signed is assigned only once, to a constant value, making it effectively constant throughout its scope. If this is not the intent, examine the logic to see if there is a missing assignment that would make is_signed not remain constant. Otherwise, declaring is_signed as const will suppress this defect. 177 if(is_neg_inf(value_) && rhs == 0) 178 { 179 return true; 180 } 181 } 182 return (compare(rhs) == -1); 183 } }}} Coverity picks this up indicating that if is_signed was const (or perhaps even better in C++11 a constexpr?) it would allow the compiler to optimize better. This is in the development trunk back to at least 1.54.",Bugs,closed,Boost 1.67.0,date_time,Boost 1.54.0,Cosmetic,fixed,,