1 /*
2  *          Copyright Andrey Semashev 2007 - 2015.
3  * Distributed under the Boost Software License, Version 1.0.
4  *    (See accompanying file LICENSE_1_0.txt or copy at
5  *          http://www.boost.org/LICENSE_1_0.txt)
6  */
7 /*!
8  * \file   src_logger_assignable.cpp
9  * \author Andrey Semashev
10  * \date   16.05.2011
11  *
12  * \brief  This header contains a test for logger assignability.
13  */
14 
15 #include <boost/log/sources/logger.hpp>
16 #include <boost/log/sources/severity_logger.hpp>
17 #include <boost/log/sources/channel_logger.hpp>
18 #include <boost/log/sources/severity_channel_logger.hpp>
19 
20 template< typename LoggerT >
test()21 void test()
22 {
23     LoggerT lg1, lg2;
24 
25     // Loggers must be assignable. The assignment operator must be taken
26     // from the composite_logger class and not auto-generated (in which
27     // case it will fail to compile because assignment in basic_logger is private).
28     lg1 = lg2;
29 }
30 
main(int,char * [])31 int main(int, char*[])
32 {
33     test< boost::log::sources::logger >();
34     test< boost::log::sources::severity_logger< > >();
35     test< boost::log::sources::channel_logger< > >();
36     test< boost::log::sources::severity_channel_logger< > >();
37 
38     return 0;
39 }
40