Блог пользователя S9M0N_R3L3Y_GH05T

Автор S9M0N_R3L3Y_GH05T, история, 22 месяца назад, По-английски

I use a header named printContainer.h for printing STL containers for debugging purposes, but I always have to comment it out before submission , sometimes I forget and get Compilation error which causes much problem and most importantly every second counts here... my template is like this:

#include <bits/stdc++.h>
#include <iostream>
#include <cmath>
#include<iomanip>
#include<cstring>
#include <queue>
#include "Templates/printContainer.h"

//Rest of the code

please tell me what to do? I heard ifdef or endif works but I couldn't make it work...maybe I am using the wrong way.

  • Проголосовать: нравится
  • +3
  • Проголосовать: не нравится

»
22 месяца назад, скрыть # |
 
Проголосовать: нравится +3 Проголосовать: не нравится
#ifndef ONLINE_JUDGE
#include "Templates/printContainer.h"
#endif
»
22 месяца назад, скрыть # |
 
Проголосовать: нравится +3 Проголосовать: не нравится

#ifndef ONLINE_JUDGE #include "Templates/printContainer.h" #else // define functions defined in template as empty as shown in comments below // #define debug(...) ; // #define crndl ; #endif