On 9/04/2018 4:09 AM, Charles Mills wrote:
#include <stdio.h>

#define __IBMCPP_TR1__ 1
#include <regex>

class myRegex
{
public:
     std::tr1::regex regexObject;
};

int main(int argc, char* argv[])
{
     printf("RegEx test 4/6/2018\n");
     std::tr1::regex::flag_type flags = std::tr1::regex::extended;     //
necessary for error
     myRegex *myRegex_p = new myRegex;
     myRegex_p->regexObject.assign("foo", flags);
     delete myRegex_p;
     return 0;
}
C++ isn't my first language and I'm not even sure I found the right documentation, but does assign create a new regex rather than modifying the existing one?

What is the scope of the new Regex? And templates can create different classes based on the parameters so the result of regexObject.assign may not even be the same type of object as when myRegex was instantiated.

I'm not sure if that is allowed or not - this sort of stuff is why I avoid C++, too complex for me :-)

--
Andrew Rowley
Black Hill Software
+61 413 302 386

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN

Reply via email to