how to set a breakpoint with boost library


I would like to add a breakpoint to put the code in BOOST_AUTO_TEST_CASE(first_test) on hold , but it is giving me bunch of errors.


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
   
#define BOOST_TEST_MODULE My Test 
#include <boost/test/included/unit_test.hpp> 

# include <iostream>
# include <sstream>



BOOST_AUTO_TEST_CASE(first_test) 
{
	int i = 1;
	BOOST_TEST(i); 
		BOOST_TEST(i == 2); 
}


int main()
{

	cout << "hello " << endl ; 
	system.pause; 
	cin.get(); 

}
Hello masterinex,

First it is system("pause"); and second try to avoid system anything.

The cin.get(); will work for a pause if needed.

The IDE you are using should have the ability to set a break point on most any line of the program.

What IDE are you using?

Line 22 is easy to spot, but next time include the error messages that you get. They tell a lot.

Hope that helps,

Andy
i think there is something with the boost library that is messing it up , here is another code, I am getting cin is undefined ??


#include <boost/regex.hpp>
#include <iostream>
#include <string>

int main()
{
std::string line;
//boost::regex pat("^Subject: (Re: |Aw: )*(.*)");

boost::regex pat("ab");

while (std::cin)
{
std::getline(std::cin, line);
boost::smatch matches;
if (boost::regex_match(line, matches, pat))
std::cout << matches[0] << std::endl;
system("pause");
}

cin.get();

system("pause");

}


You mean std::cin.get(). And std::system("pause").
Last edited on
Topic archived. No new replies allowed.