Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
 All Forums
 Visual Assist
 Technical Support
 VAX auto-complete messes up std::string::c_str()

You must be registered to post a reply.
Click here to register.

Screensize:
UserName:
Password:
Format: BoldItalicizeUnderlineStrikethrough Align leftCenterAlign right Insert horizontal ruleUpload and insert imageInsert hyperlinkInsert email addressInsert codeInsert quoted textInsert listInsert Emoji
   
Message:

Forum code is on.
Html is off.

 
Check to subscribe to this topic.
   

T O P I C    R E V I E W
pbrown Posted - Jul 23 2021 : 10:14:21 PM
I have some code where I'm using std::string to build up strings that I then need to pass to C code. To do this, I'm trying to use the c_str() method of std::string.

However, VAX's auto-completion logic keeps trying to turn:

std::string var = "Hello";
var.c_str()

into something like:

var.~basic_string()

When I look at the definition for c_str() in the Microsoft headers, I see:

    _NODISCARD _Ret_z_ const _Elem* c_str() const noexcept {
        return _Mypair._Myval2._Myptr();
    }

The "_NODISCARD" part seems to be confusing VAX. I worked around this by adding:

#define _NODISCARD

to my va_stdafx.h file.

Particulars:
VA_X.dll file version 10.9.2406.0 built 2021.04.23
DevEnv.exe version 16.9.31105.61 Professional
1   L A T E S T    R E P L I E S    (Newest First)
feline Posted - Jul 26 2021 : 06:59:04 AM
Thank you for the bug report and your logical work around. So far I cannot reproduce the problem here though, and I have just checked two different VS2019 solutions, in case there is something odd about my default test solution.

In Solution Explorer, if you right click on your C++ project, go to Properties, and look at General settings, what to you have your Platform Toolset set to?

I am assuming this is "Visual Studio 2019 (v142)" but it might well be something else.

© 2023 Whole Tomato Software, LLC Go To Top Of Page
Snitz Forums 2000