Click here to Skip to main content
15,892,072 members

Welcome to the Lounge

   

For discussing anything related to a software developer's life but is not for programming questions. Got a programming question?

The Lounge is rated Safe For Work. If you're about to post something inappropriate for a shared office environment, then don't post it. No ads, no abuse, and no programming questions. Trolling, (political, climate, religious or whatever) will result in your account being removed.

 
GeneralEZ function Xit / Ntry trace Pin
BernardIE531724-May-21 19:46
BernardIE531724-May-21 19:46 
GeneralRe: EZ function Xit / Ntry trace Pin
OriginalGriff24-May-21 20:48
mveOriginalGriff24-May-21 20:48 
GeneralRe: EZ function Xit / Ntry trace Pin
BernardIE531725-May-21 7:12
BernardIE531725-May-21 7:12 
GeneralRe: EZ function Xit / Ntry trace Pin
OriginalGriff25-May-21 8:03
mveOriginalGriff25-May-21 8:03 
GeneralRe: EZ function Xit / Ntry trace Pin
BernardIE531725-May-21 8:27
BernardIE531725-May-21 8:27 
GeneralRe: EZ function Xit / Ntry trace Pin
Sean Ewington25-May-21 8:43
staffSean Ewington25-May-21 8:43 
GeneralRe: EZ function Xit / Ntry trace Pin
BernardIE531725-May-21 8:49
BernardIE531725-May-21 8:49 
GeneralRe: EZ function Xit / Ntry trace Pin
Sean Ewington25-May-21 9:13
staffSean Ewington25-May-21 9:13 
I have gone in and fixed it.

Basically you want to hit the Source button in the top-right of the editor, and change this

struct cpreamble<br />
{<br />
&nbsp;&nbsp; &nbsp;std::string m_func;<br />
&nbsp;&nbsp; &nbsp;cpreamble(const char* func) : m_func(func) { std::cout &lt;&lt; fg_yellow &lt;&lt; func &lt;&lt; fg_white &lt;&lt; &quot; entry&quot; &lt;&lt; std::endl; }<br />
&nbsp;&nbsp; &nbsp;~cpreamble() { std::cout &lt;&lt; fg_cyan &lt;&lt; m_func &lt;&lt; fg_white &lt;&lt; &quot; exit&quot; &lt;&lt; std::endl; }<br />
};<br />
#define PREAMBLE cpreamble _cpreamble(__func__);<br />
So one can utilize it as below.<br />
void foobar()<br />
{<br />
&nbsp;&nbsp; &nbsp;PREAMBLE // first line in function<br />
&nbsp;&nbsp; &nbsp;// full body of function ...<br />
}<br />

To this:

<pre lang="C++">struct cpreamble
{
std::string m_func;
cpreamble(const char* func) : m_func(func) { std::cout &lt;&lt; fg_yellow &lt;&lt; func &lt;&lt; fg_white &lt;&lt; " entry" &lt;&lt; std::endl; }
~cpreamble() { std::cout &lt;&lt; fg_cyan &lt;&lt; m_func &lt;&lt; fg_white &lt;&lt; " exit" &lt;&lt; std::endl; }
};
#define PREAMBLE cpreamble _cpreamble(__func__);
So one can utilize it as below.
void foobar()
{
PREAMBLE // first line in function
// full body of function ...
}</pre>

Or, you want to leave that Source button alone, paste in your code exactly like this:

struct cpreamble
{
std::string m_func;
cpreamble(const char* func) : m_func(func) { std::cout << fg_yellow << func << fg_white << " entry" << std::endl; }
~cpreamble() { std::cout << fg_cyan << m_func << fg_white << " exit" << std::endl; }
};
#define PREAMBLE cpreamble _cpreamble(__func__);
So one can utilize it as below.
void foobar()
{
PREAMBLE // first line in function
// full body of function ...
}

Then select it all and go to the Formatted dropdown, and select "Formatted"
Thanks,
Sean Ewington
CodeProject

GeneralRe: EZ function Xit / Ntry trace Pin
OriginalGriff25-May-21 9:09
mveOriginalGriff25-May-21 9:09 
GeneralRe: EZ function Xit / Ntry trace Pin
Sean Ewington25-May-21 11:03
staffSean Ewington25-May-21 11:03 
GeneralJust Me? Pin
BernardIE531724-May-21 18:17
BernardIE531724-May-21 18:17 
QuestionRe: Just Me? Pin
David Crow24-May-21 16:09
David Crow24-May-21 16:09 
GeneralRe: Just Me? Pin
Jacquers24-May-21 19:08
Jacquers24-May-21 19:08 
GeneralMore Weaseling. Pin
Gerry Schmitz24-May-21 14:03
mveGerry Schmitz24-May-21 14:03 
GeneralRe: More Weaseling. Pin
David O'Neil24-May-21 14:05
professionalDavid O'Neil24-May-21 14:05 
GeneralRe: More Weaseling. Pin
Slacker00724-May-21 14:23
professionalSlacker00724-May-21 14:23 
GeneralRe: More Weaseling. Pin
Greg Utas24-May-21 14:41
professionalGreg Utas24-May-21 14:41 
GeneralRe: More Weaseling. Pin
Slacker00724-May-21 14:48
professionalSlacker00724-May-21 14:48 
GeneralRe: More Weaseling. Pin
Greg Utas24-May-21 16:27
professionalGreg Utas24-May-21 16:27 
GeneralRe: More Weaseling. Pin
David Crow24-May-21 16:12
David Crow24-May-21 16:12 
GeneralRe: More Weaseling. Pin
Gerry Schmitz24-May-21 16:24
mveGerry Schmitz24-May-21 16:24 
GeneralRe: More Weaseling. Pin
Dave Kreskowiak24-May-21 14:24
mveDave Kreskowiak24-May-21 14:24 
GeneralRe: More Weaseling. Pin
Ron Anders24-May-21 17:11
Ron Anders24-May-21 17:11 
GeneralRe: More Weaseling. Pin
Dave Kreskowiak24-May-21 17:22
mveDave Kreskowiak24-May-21 17:22 
GeneralRe: More Weaseling. Pin
enhzflep24-May-21 17:58
enhzflep24-May-21 17:58 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.