Program Listing for File debug.hpp

Return to documentation for file (SeQuant/core/utility/debug.hpp)

//
// Created by Eduard Valeyev on 7/30/25.
//

#ifndef SEQUANT_CORE_UTILITY_DEBUG_HPP
#define SEQUANT_CORE_UTILITY_DEBUG_HPP

#include <cstdio>
#include <sstream>

namespace sequant {

template <typename... Args>
void printf(Args&&... args) {
  std::ostringstream oss;
  (oss << ... << std::forward<Args>(args));
  std::printf("%s", oss.str().c_str());
}

template <typename... Args>
void wprintf(Args&&... args) {
  std::wostringstream oss;
  (oss << ... << std::forward<Args>(args));
  std::wprintf(L"%ls", oss.str().c_str());
}

}  // namespace sequant

#endif  // SEQUANT_CORE_UTILITY_DEBUG_HPP