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

rowbearto

  • Senior Community Member
  • Posts: 1344
  • Hero Points: 100
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

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

Dennis

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 2633
  • Hero Points: 406
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: 1344
  • Hero Points: 100
Re: std::string::size() evaluated type is incorrect
« Reply #3 on: March 19, 2019, 05:38:01 pm »
Thanks Dennis! Really appreciate it!