// detail/util.hpp// Boost Logging library//// Author: John Torjo, www.torjo.com//// Copyright (C) 2007 John Torjo (see www.torjo.com for email)//// Distributed under the Boost Software License, Version 1.0.// (See accompanying file LICENSE_1_0.txt or copy at// http://www.boost.org/LICENSE_1_0.txt)//// See http://www.boost.org for updates, documentation, and revision history.// See http://www.torjo.com/log2/ for more details#ifndef JT28092007_detail_util_HPP_DEFINED#define JT28092007_detail_util_HPP_DEFINED#if defined(_MSC_VER) && (_MSC_VER >= 1020)# pragma once#endif/* make sure we don't need any of our headers included from here! we're included from fwd.hpp!*/namespaceboost{namespacelogging{structoverride{};structdefault_{};template<classparam,classdefault_type>structuse_default{typedefparamtype;};template<classdefault_type>structuse_default<default_,default_type>{typedefdefault_typetype;};structvoid_{};namespacedetail{/** this is just a simple way to always return override; however, in this case we postpone the instantiation until our template parameter is known For instance: @code typedef typename formatter::msg_type<override>::type msg_type; @endcode would compute msg_type right now; however, we want the compiler to wait, until the user has actually set the msg_type, for example, using the BOOST_LOG_FORMAT_MSG macro. Thus, we do: @code typedef typename detail::to_override<format_base>::type T; typedef typename formatter::msg_type<T>::type msg_type; @endcode */template<class>structto_override{typedefoverridetype;};template<>structto_override<void_>{typedefvoid_type;};}structansi_unicode_char_holder{constchar*str;constwchar_t*wstr;ansi_unicode_char_holder(constchar*str,constwchar_t*wstr):str(str),wstr(wstr){}operatorconstchar*()const{returnstr;}operatorconstwchar_t*()const{returnwstr;}};}}#define BOOST_LOG_CONCATENATE2(a,b) a ## b#define BOOST_LOG_CONCATENATE(a,b) BOOST_LOG_CONCATENATE2(a,b)#endif