Suppose you have this code
template <typename B_G>
void back_edge(E e, const B_G&) {
log << "back edge " << e << "\t\t : id " << m_graph[e].id << " ("
<< m_graph[m_graph.source(e)].id << ", " << m_graph[m_graph.target(e)].id << ")" << "\n";
}
and you want to comment out the body of the function to skip the log, and maybe in the future uncomment it, and comment it back again
template <typename B_G>
void back_edge(E e, const B_G&) {
#if 0
log << "back edge " << e << "\t\t : id " << m_graph[e].id << " ("
<< m_graph[m_graph.source(e)].id << ", " << m_graph[m_graph.target(e)].id << ")" << "\n";
#endif
}
never ever use //:
template <typename B_G>
void back_edge(E e, const B_G&) {
// log << "back edge " << e << "\t\t : id " << m_graph[e].id << " ("
// << m_graph[m_graph.source(e)].id << ", " << m_graph[m_graph.target(e)].id << ")" << "\n";
}
Never ever use `/* */:
template <typename B_G>
void back_edge(E e, const B_G&) {
/*
log << "back edge " << e << "\t\t : id " << m_graph[e].id << " ("
<< m_graph[m_graph.source(e)].id << ", " << m_graph[m_graph.target(e)].id << ")" << "\n";
*/
}
With the proper way of commenting out the code, if you want the code back again you just change the 0 to 1:
Suppose you have this code
and you want to comment out the body of the function to skip the log, and maybe in the future uncomment it, and comment it back again
never ever use
//:Never ever use `/* */:
With the proper way of commenting out the code, if you want the code back again you just change the 0 to 1: