Author Topic: C++ 11 Braces for Initialization in SEPro v24.0.0.8 Win 64-bit  (Read 1002 times)

Allan

  • Community Member
  • Posts: 22
  • Hero Points: 0
C++ 11 Braces for Initialization in SEPro v24.0.0.8 Win 64-bit
« on: October 14, 2019, 03:57:45 am »
I have the following declaration in a header file:
     
Code: [Select]
static constexpr int days_in_feb = {28}; 
When I hover my mouse over days_in_feb in my *.cpp file, the tool tip shows:
     
Code: [Select]
const int Chrono::days_in_feb = {}
Shouldn't the tool tip show:
     
Code: [Select]
static constexpr int days_in_feb = {28}
Or has this not been implemented in SE?

Dennis

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 2934
  • Hero Points: 438
Re: C++ 11 Braces for Initialization in SEPro v24.0.0.8 Win 64-bit
« Reply #1 on: October 14, 2019, 03:32:12 pm »
We generally compress braced initializer expressions down to just to braces for brevity, since the normal case was that you used braced initializers only for initializing large arrays, so you generally did not want such a huge verbose string of values.  I know that's old-school thinking, and the new mantra is to use universal brace initializers everywhere.  But, there is a lot of old-school code out there.

I will put in a feature request to add a separate tagging flag for "constexpr" vs "const", that will make it possible for us to show the tool top correctly, and also look into why "static" isn't showing up.  It may be that we are omitting that just for brevity also, the concern being for the type of the symbol more than it's scope.

If you initialized it without the unnecessary braces, you would be able to see the value.
Code: [Select]
static constexpr auto days_in_feb = 28;

Allan

  • Community Member
  • Posts: 22
  • Hero Points: 0
Re: C++ 11 Braces for Initialization in SEPro v24.0.0.8 Win 64-bit
« Reply #2 on: October 15, 2019, 01:47:17 am »
Thanks, Dennis. I'll look for the changes you mention in a future release.

Dennis

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 2934
  • Hero Points: 438
Re: C++ 11 Braces for Initialization in SEPro v24.0.0.8 Win 64-bit
« Reply #3 on: December 05, 2019, 01:26:06 am »
The changes will be in 24.0.1.  For long brace block initializers, the value will simply be displayed as {...}.