SlickEdit Community

SlickEdit Product Discussion => SlickEdit® => Topic started by: rowbearto on March 09, 2019, 07:03:15 pm

Title: std::string::size() evaluated type is incorrect
Post by: rowbearto on March 09, 2019, 07:03:15 pm
See attached screenshot and code sample.

The evaluated type for "std::string::size()" should end with ::size_type, what is evaluated seems incorrect.

Or, when I use a different code browsing tool, cquery, it tells me that the evaluated type of "helloSize" is "unsigned long".

Code: [Select]
#include <iostream>
#include <string>

int main()
{
    std::string hello("Hello");
    std::string world("world");
    auto helloSize = hello.size();
    auto worldSize = world.size();
    auto minSize = std::min(helloSize, worldSize);
    std::cout << "minSize = " << minSize << " \n";
    return 0;
}
Title: Re: std::string::size() evaluated type is incorrect
Post by: Dennis on March 13, 2019, 03:15:34 pm
I will look into this.
Title: Re: std::string::size() evaluated type is incorrect
Post by: Dennis on March 19, 2019, 04:28:25 pm
This should be fixed in the next hot fix for 23.0.1.  I had to implement template function template parameter type inference in order to get this going (on account of std::min).
Title: Re: std::string::size() evaluated type is incorrect
Post by: rowbearto on March 19, 2019, 05:38:01 pm
Thanks Dennis! Really appreciate it!