Author Topic: std::string::size() evaluated type is incorrect  (Read 1741 times)

rowbearto

  • Senior Community Member
  • Posts: 2335
  • Hero Points: 132
std::string::size() evaluated type is incorrect
« 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;
}
« Last Edit: March 09, 2019, 10:47:10 PM by rowbearto »

Dennis

  • Senior Community Member
  • Posts: 3955
  • Hero Points: 515
Re: std::string::size() evaluated type is incorrect
« Reply #1 on: March 13, 2019, 03:15:34 PM »
I will look into this.

Dennis

  • Senior Community Member
  • Posts: 3955
  • Hero Points: 515
Re: std::string::size() evaluated type is incorrect
« Reply #2 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).

rowbearto

  • Senior Community Member
  • Posts: 2335
  • Hero Points: 132
Re: std::string::size() evaluated type is incorrect
« Reply #3 on: March 19, 2019, 05:38:01 PM »
Thanks Dennis! Really appreciate it!