code:
#include "MessageAggregatorMainWindow.hpp"

#include <QtWidgets>
#include <QDateTime>

#include "DecodesModel.hpp"
#include "BeaconsModel.hpp"
#include "ClientWidget.hpp"

using port_type = MessageServer::port_type;

namespace
{
  char const * const headings[] = {
    QT_TRANSLATE_NOOP ("MessageAggregatorMainWindow", "Time On"),
    QT_TRANSLATE_NOOP ("MessageAggregatorMainWindow", "Time Off"),
    QT_TRANSLATE_NOOP ("MessageAggregatorMainWindow", "Callsign"),
    QT_TRANSLATE_NOOP ("MessageAggregatorMainWindow", "Grid"),
    QT_TRANSLATE_NOOP ("MessageAggregatorMainWindow", "Name"),
    QT_TRANSLATE_NOOP ("MessageAggregatorMainWindow", "Frequency"),
    QT_TRANSLATE_NOOP ("MessageAggregatorMainWindow", "Mode"),
    QT_TRANSLATE_NOOP ("MessageAggregatorMainWindow", "Sent"),
    QT_TRANSLATE_NOOP ("MessageAggregatorMainWindow", "Rec'd"),
    QT_TRANSLATE_NOOP ("MessageAggregatorMainWindow", "Power"),
    QT_TRANSLATE_NOOP ("MessageAggregatorMainWindow", "Operator"),
    QT_TRANSLATE_NOOP ("MessageAggregatorMainWindow", "My Call"),
    QT_TRANSLATE_NOOP ("MessageAggregatorMainWindow", "My Grid"),
    QT_TRANSLATE_NOOP ("MessageAggregatorMainWindow", "Comments"),
  };
}

MessageAggregatorMainWindow::MessageAggregatorMainWindow ()
  : log_ {new QStandardItemModel {0, 14, this}}
  , decodes_model_ {new DecodesModel {this}}
  , beacons_model_ {new BeaconsModel {this}}
  , server_ {new MessageServer {this}}
  , multicast_group_line_edit_ {new QLineEdit}
  , log_table_view_ {new QTableView}
  , add_call_of_interest_action_ {new QAction {tr ("&Add callsign"), this}}
  , delete_call_of_interest_action_ {new QAction {tr ("&Delete callsign"), this}}
  , last_call_of_interest_action_ {new QAction {tr ("&Highlight last only"), this}}
  , call_of_interest_bg_colour_action_ {new QAction {tr ("&Background colour"), this}}
  , call_of_interest_fg_colour_action_ {new QAction {tr ("&Foreground colour"), this}}
{
  // logbook
  int column {0};
  for (auto const& heading : headings)
    {
      log_->setHeaderData (column++, Qt::Horizontal, tr (heading));
    }
  connect (server_, &MessageServer::qso_logged, this, &MessageAggregatorMainWindow::log_qso);

  // menu bar
  auto file_menu = menuBar ()->addMenu (tr ("&File"));

  auto exit_action = new QAction {tr ("E&xit"), this};
  exit_action->setShortcuts (QKeySequence::Quit);
  exit_action->setToolTip (tr ("Exit the application"));
  file_menu->addAction (exit_action);
  connect (exit_action, &QAction::triggered, this, &MessageAggregatorMainWindow::close);

  view_menu_ = menuBar ()->addMenu (tr ("&View"));

  // central layout
  auto central_layout = new QVBoxLayout;

  // server details
  auto port_spin_box = new QSpinBox;
  port_spin_box->setMinimum (1);
  port_spin_box->setMaximum (std::numeric_limits<port_type>::max ());
  auto group_box_layout = new QFormLayout;
  group_box_layout->addRow (tr ("Port number:"), port_spin_box);
  group_box_layout->addRow (tr ("Multicast Group (blank for unicast server):"), multicast_group_line_edit_);
  auto group_box = new QGroupBox {tr ("Server Details")};
  group_box->setLayout (group_box_layout);
  central_layout->addWidget (group_box);

  log_table_view_->setModel (log_);
  log_table_view_->verticalHeader ()->hide ();
  central_layout->addWidget (log_table_view_);

  // central widget
  auto central_widget = new QWidget;
  central_widget->setLayout (central_layout);

  // main window setup
  setCentralWidget (central_widget);
  setDockOptions (AnimatedDocks | AllowNestedDocks | AllowTabbedDocks);
  setTabPosition (Qt::BottomDockWidgetArea, QTabWidget::North);

  QDockWidget * calls_dock {new QDockWidget {tr ("Calls of Interest"), this}};
  calls_dock->setAllowedAreas (Qt::RightDockWidgetArea);
  calls_of_interest_ = new QListWidget {calls_dock};
  calls_of_interest_->setContextMenuPolicy (Qt::ActionsContextMenu);
  calls_of_interest_->insertAction (nullptr, add_call_of_interest_action_);
  connect (add_call_of_interest_action_, &QAction::triggered, [this] () {
      auto item = new QListWidgetItem {};
      item->setFlags (item->flags () | Qt::ItemIsEditable);
      item->setData (Qt::UserRole, QString {});
      calls_of_interest_->addItem (item);
      calls_of_interest_->editItem (item);
    });
  calls_of_interest_->insertAction (nullptr, delete_call_of_interest_action_);
  connect (delete_call_of_interest_action_, &QAction::triggered, [this] () {
      for (auto item : calls_of_interest_->selectedItems ())
        {
          auto old_call = item->data (Qt::UserRole);
          if (old_call.isValid ()) change_highlighting (old_call.toString ());
          delete item;
        }
    });
  calls_of_interest_->insertAction (nullptr, last_call_of_interest_action_);
  connect (last_call_of_interest_action_, &QAction::triggered, [this] () {
      for (auto item : calls_of_interest_->selectedItems ())
        {
          auto old_call = item->data (Qt::UserRole);
          change_highlighting (old_call.toString ());
          change_highlighting (old_call.toString ()
                               , item->background ().color (), item->foreground ().color (), true);
          delete item;
        }
    });
  calls_of_interest_->insertAction (nullptr, call_of_interest_bg_colour_action_);
  connect (call_of_interest_bg_colour_action_, &QAction::triggered, [this] () {
      for (auto item : calls_of_interest_->selectedItems ())
        {
          auto old_call = item->data (Qt::UserRole);
          auto new_colour = QColorDialog::getColor (item->background ().color ()
                                                    , this, tr ("Select background color"));
          if (new_colour.isValid ())
            {
              change_highlighting (old_call.toString (), new_colour, item->foreground ().color ());
              item->setBackground (new_colour);
            }
        }
    });
  calls_of_interest_->insertAction (nullptr, call_of_interest_fg_colour_action_);
  connect (call_of_interest_fg_colour_action_, &QAction::triggered, [this] () {
      for (auto item : calls_of_interest_->selectedItems ())
        {
          auto old_call = item->data (Qt::UserRole);
          auto new_colour = QColorDialog::getColor (item->foreground ().color ()
                                                    , this, tr ("Select foreground color"));
          if (new_colour.isValid ())
            {
              change_highlighting (old_call.toString (), item->background ().color (), new_colour);
              item->setForeground (new_colour);
            }
        }
    });
  connect (calls_of_interest_, &QListWidget::itemChanged, [this] (QListWidgetItem * item) {
      auto old_call = item->data (Qt::UserRole);
      auto new_call = item->text ().toUpper ();
      if (new_call != old_call)
        {
          // tell all clients
          if (old_call.isValid ())
            {
              change_highlighting (old_call.toString ());
            }
          item->setData (Qt::UserRole, new_call);
          item->setText (new_call);
          auto bg = item->listWidget ()->palette ().text ().color ();
          auto fg = item->listWidget ()->palette ().base ().color ();
          item->setBackground (bg);
          item->setForeground (fg);
          change_highlighting (new_call, bg, fg);
        }
    });

  calls_dock->setWidget (calls_of_interest_);
  addDockWidget (Qt::RightDockWidgetArea, calls_dock);
  view_menu_->addAction (calls_dock->toggleViewAction ());
  view_menu_->addSeparator ();

  // connect up server
  connect (server_, &MessageServer::error, [this] (QString const& message) {
      QMessageBox::warning (this, QApplication::applicationName (), tr ("Network Error"), message);
    });
  connect (server_, &MessageServer::client_opened, this, &MessageAggregatorMainWindow::add_client);
  connect (server_, &MessageServer::client_closed, this, &MessageAggregatorMainWindow::remove_client);
  connect (server_, &MessageServer::client_closed, decodes_model_, &DecodesModel::clear_decodes);
  connect (server_, &MessageServer::client_closed, beacons_model_, &BeaconsModel::clear_decodes);
  connect (server_, &MessageServer::decode, [this] (bool is_new, QString const& id, QTime time
                                                    , qint32 snr, float delta_time
                                                    , quint32 delta_frequency, QString const& mode
                                                    , QString const& message, bool low_confidence
                                                    , bool off_air) {
             decodes_model_->add_decode (is_new, id, time, snr, delta_time, delta_frequency, mode, message
                                         , low_confidence, off_air, dock_widgets_[id]->fast_mode ());});
  connect (server_, &MessageServer::WSPR_decode, beacons_model_, &BeaconsModel::add_beacon_spot);
  connect (server_, &MessageServer::clear_decodes, decodes_model_, &DecodesModel::clear_decodes);
  connect (server_, &MessageServer::clear_decodes, beacons_model_, &BeaconsModel::clear_decodes);
  connect (decodes_model_, &DecodesModel::reply, server_, &MessageServer::reply);

  // UI behaviour
  connect (port_spin_box, static_cast<void (QSpinBox::*)(int)> (&QSpinBox::valueChanged)
           , [this] (port_type port) {server_->start (port);});
  connect (multicast_group_line_edit_, &QLineEdit::editingFinished, [this, port_spin_box] () {
      server_->start (port_spin_box->value (), QHostAddress {multicast_group_line_edit_->text ()});
    });

  port_spin_box->setValue (2237); // start up in unicast mode
  show ();
}

void MessageAggregatorMainWindow::log_qso (QString const& /*id*/, QDateTime time_off, QString const& dx_call
                                           , QString const& dx_grid, Frequency dial_frequency, QString const& mode
                                           , QString const& report_sent, QString const& report_received
                                           , QString const& tx_power, QString const& comments
                                           , QString const& name, QDateTime time_on, QString const& operator_call
                                           , QString const& my_call, QString const& my_grid)
{
  QList<QStandardItem *> row;
  row << new QStandardItem {time_on.toString ("dd-MMM-yyyy hh:mm:ss")}
  << new QStandardItem {time_off.toString ("dd-MMM-yyyy hh:mm:ss")}
  << new QStandardItem {dx_call}
  << new QStandardItem {dx_grid}
  << new QStandardItem {name}
  << new QStandardItem {Radio::frequency_MHz_string (dial_frequency)}
  << new QStandardItem {mode}
  << new QStandardItem {report_sent}
  << new QStandardItem {report_received}
  << new QStandardItem {tx_power}
  << new QStandardItem {operator_call}
  << new QStandardItem {my_call}
  << new QStandardItem {my_grid}
  << new QStandardItem {comments};
  log_->appendRow (row);
  log_table_view_->resizeColumnsToContents ();
  log_table_view_->horizontalHeader ()->setStretchLastSection (true);
  log_table_view_->scrollToBottom ();
}

void MessageAggregatorMainWindow::add_client (QString const& id, QString const& version, QString const& revision)
{
  auto dock = new ClientWidget {decodes_model_, beacons_model_, id, version, revision, calls_of_interest_, this};
  dock->setAttribute (Qt::WA_DeleteOnClose);
  auto view_action = dock->toggleViewAction ();
  view_action->setEnabled (true);
  view_menu_->addAction (view_action);
  addDockWidget (Qt::BottomDockWidgetArea, dock);
  connect (server_, &MessageServer::status_update, dock, &ClientWidget::update_status);
  connect (server_, &MessageServer::decode, dock, &ClientWidget::decode_added);
  connect (server_, &MessageServer::WSPR_decode, dock, &ClientWidget::beacon_spot_added);
  connect (server_, &MessageServer::clear_decodes, dock, &ClientWidget::clear_decodes);
  connect (dock, &ClientWidget::do_reply, decodes_model_, &DecodesModel::do_reply);
  connect (dock, &ClientWidget::do_halt_tx, server_, &MessageServer::halt_tx);
  connect (dock, &ClientWidget::do_free_text, server_, &MessageServer::free_text);
  connect (dock, &ClientWidget::location, server_, &MessageServer::location);
  connect (view_action, &QAction::toggled, dock, &ClientWidget::setVisible);
  connect (dock, &ClientWidget::highlight_callsign, server_, &MessageServer::highlight_callsign);
  dock_widgets_[id] = dock;
  server_->replay (id);         // request decodes and status
}

void MessageAggregatorMainWindow::remove_client (QString const& id)
{
  auto iter = dock_widgets_.find (id);
  if (iter != std::end (dock_widgets_))
    {
      (*iter)->close ();
      dock_widgets_.erase (iter);
    }
}

MessageAggregatorMainWindow::~MessageAggregatorMainWindow ()
{
  for (auto client : dock_widgets_)
    {
      delete client;
    }
}

void MessageAggregatorMainWindow::change_highlighting (QString const& call, QColor const& bg, QColor const& fg
                                                       , bool last_only)
{
  for (auto id : dock_widgets_.keys ())
    {
      server_->highlight_callsign (id, call, bg, fg, last_only);
    }
}

#include "moc_MessageAggregatorMainWindow.cpp"


code:
//---------------------------------------------------------------------------//
// Copyright (c) 2013 Kyle Lutz <kyle.r.lutz@gmail.com>
//
// 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://boostorg.github.com/compute for more information.
//---------------------------------------------------------------------------//

#ifndef BOOST_COMPUTE_HPP
#define BOOST_COMPUTE_HPP

#include <boost/compute/algorithm.hpp>
#include <boost/compute/allocator.hpp>
#include <boost/compute/async.hpp>
#include <boost/compute/buffer.hpp>
#include <boost/compute/cl.hpp>
#include <boost/compute/command_queue.hpp>
#include <boost/compute/config.hpp>
#include <boost/compute/container.hpp>
#include <boost/compute/context.hpp>
#include <boost/compute/device.hpp>
#include <boost/compute/functional.hpp>
#include <boost/compute/image.hpp>
#include <boost/compute/iterator.hpp>
#include <boost/compute/kernel.hpp>
#include <boost/compute/lambda.hpp>
#include <boost/compute/pipe.hpp>
#include <boost/compute/platform.hpp>
#include <boost/compute/program.hpp>
#include <boost/compute/random.hpp>
#include <boost/compute/svm.hpp>
#include <boost/compute/system.hpp>
#include <boost/compute/types.hpp>
#include <boost/compute/user_event.hpp>
#include <boost/compute/utility.hpp>
#include <boost/compute/version.hpp>

#ifdef BOOST_COMPUTE_HAVE_HDR_CL_EXT
#include <boost/compute/cl_ext.hpp>
#endif

#endif // BOOST_COMPUTE_HPP

license: mit


code:
//  ratio_io
//
//  (C) Copyright Howard Hinnant
//  (C) Copyright 2010 Vicente J. Botet Escriba
//  Use, modification and distribution are subject to 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).
//
// This code was adapted by Vicente from Howard Hinnant's experimental work
// on chrono i/o under lvm/libc++ to Boost

#ifndef BOOST_RATIO_DETAIL_RATIO_IO_HPP
#define BOOST_RATIO_DETAIL_RATIO_IO_HPP

/*

    ratio_io synopsis

#include <ratio>
#include <string>

namespace boost
{

template <class Ratio, class CharT>
struct ratio_string
{
    static basic_string<CharT> short_name();
    static basic_string<CharT> long_name();
};

}  // boost

*/

#include <boost/config.hpp>
#include <boost/ratio/ratio.hpp>
#include <boost/type_traits/integral_constant.hpp>
#include <string>
#include <sstream>

#if defined(BOOST_NO_CXX11_UNICODE_LITERALS) || defined(BOOST_NO_CXX11_CHAR16_T) || defined(BOOST_NO_CXX11_CHAR32_T) || defined(BOOST_NO_CXX11_U16STRING) || defined(BOOST_NO_CXX11_U32STRING)
#if defined BOOST_RATIO_HAS_UNICODE_SUPPORT
#undef BOOST_RATIO_HAS_UNICODE_SUPPORT
#endif
#else
#define BOOST_RATIO_HAS_UNICODE_SUPPORT 1
#endif

namespace boost {

//template <class Ratio>
//struct ratio_string_is_localizable : false_type {};
//template <class Ratio>
//struct ratio_string_id : integral_constant<int,0> {};

template <class Ratio, class CharT>
struct ratio_string
{
    static std::basic_string<CharT> short_name() {return long_name();}
    static std::basic_string<CharT> long_name();
    static std::basic_string<CharT> symbol() {return short_name();}
    static std::basic_string<CharT> prefix() {return long_name();}
};

template <class Ratio, class CharT>
std::basic_string<CharT>
ratio_string<Ratio, CharT>::long_name()
{
    std::basic_ostringstream<CharT> os;
    os << CharT('[') << Ratio::num << CharT('/')
                        << Ratio::den << CharT(']');
    return os.str();
}

#ifdef BOOST_RATIO_HAS_STATIC_STRING
namespace ratio_detail {
template <class Ratio, class CharT>
struct ratio_string_static
{
    static std::string short_name() {
        return std::basic_string<CharT>(
                static_string::c_str<
                        typename ratio_static_string<Ratio, CharT>::short_name
                    >::value);
    }
    static std::string long_name()  {
        return std::basic_string<CharT>(
                static_string::c_str<
                    typename ratio_static_string<Ratio, CharT>::long_name
                >::value);
    }
    static std::basic_string<CharT> symbol() {return short_name();}
    static std::basic_string<CharT> prefix() {return long_name();}
};
}
#endif
// atto
//template <>
//struct ratio_string_is_localizable<atto> : true_type {};
//
//template <>
//struct ratio_string_id<atto> : integral_constant<int,-18> {};

#ifdef BOOST_RATIO_HAS_STATIC_STRING
template <typename CharT>
struct ratio_string<atto, CharT> :
    ratio_detail::ratio_string_static<atto,CharT>
{};

#else
template <>
struct ratio_string<atto, char>
{
    static std::string short_name() {return std::string(1, 'a');}
    static std::string long_name()  {return std::string("atto");}
    static std::string symbol() {return short_name();}
    static std::string prefix() {return long_name();}
};

#if BOOST_RATIO_HAS_UNICODE_SUPPORT

template <>
struct ratio_string<atto, char16_t>
{
    static std::u16string short_name() {return std::u16string(1, u'a');}
    static std::u16string long_name()  {return std::u16string(u"atto");}
    static std::u16string symbol() {return short_name();}
    static std::u16string prefix() {return long_name();}
};

template <>
struct ratio_string<atto, char32_t>
{
    static std::u32string short_name() {return std::u32string(1, U'a');}
    static std::u32string long_name()  {return std::u32string(U"atto");}
    static std::u32string symbol() {return short_name();}
    static std::u32string prefix() {return long_name();}
};

#endif

#ifndef BOOST_NO_STD_WSTRING
template <>
struct ratio_string<atto, wchar_t>
{
    static std::wstring short_name() {return std::wstring(1, L'a');}
    static std::wstring long_name()  {return std::wstring(L"atto");}
    static std::wstring symbol() {return short_name();}
    static std::wstring prefix() {return long_name();}
};
#endif
#endif

// femto

//template <>
//struct ratio_string_is_localizable<femto> : true_type {};
//
//template <>
//struct ratio_string_id<femto> : integral_constant<int,-15> {};

#ifdef BOOST_RATIO_HAS_STATIC_STRING
template <typename CharT>
struct ratio_string<femto, CharT> :
    ratio_detail::ratio_string_static<femto,CharT>
{};

#else

template <>
struct ratio_string<femto, char>
{
    static std::string short_name() {return std::string(1, 'f');}
    static std::string long_name()  {return std::string("femto");}
    static std::string symbol() {return short_name();}
    static std::string prefix() {return long_name();}
};

#if BOOST_RATIO_HAS_UNICODE_SUPPORT

template <>
struct ratio_string<femto, char16_t>
{
    static std::u16string short_name() {return std::u16string(1, u'f');}
    static std::u16string long_name()  {return std::u16string(u"femto");}
    static std::u16string symbol() {return short_name();}
    static std::u16string prefix() {return long_name();}
};

template <>
struct ratio_string<femto, char32_t>
{
    static std::u32string short_name() {return std::u32string(1, U'f');}
    static std::u32string long_name()  {return std::u32string(U"femto");}
    static std::u32string symbol() {return short_name();}
    static std::u32string prefix() {return long_name();}
};

#endif

#ifndef BOOST_NO_STD_WSTRING
template <>
struct ratio_string<femto, wchar_t>
{
    static std::wstring short_name() {return std::wstring(1, L'f');}
    static std::wstring long_name()  {return std::wstring(L"femto");}
    static std::wstring symbol() {return short_name();}
    static std::wstring prefix() {return long_name();}
};
#endif
#endif

// pico

//template <>
//struct ratio_string_is_localizable<pico> : true_type {};
//
//template <>
//struct ratio_string_id<pico> : integral_constant<int,-12> {};

#ifdef BOOST_RATIO_HAS_STATIC_STRING
template <typename CharT>
struct ratio_string<pico, CharT> :
    ratio_detail::ratio_string_static<pico,CharT>
{};

#else
template <>
struct ratio_string<pico, char>
{
    static std::string short_name() {return std::string(1, 'p');}
    static std::string long_name()  {return std::string("pico");}
    static std::string symbol() {return short_name();}
    static std::string prefix() {return long_name();}
};

#if BOOST_RATIO_HAS_UNICODE_SUPPORT

template <>
struct ratio_string<pico, char16_t>
{
    static std::u16string short_name() {return std::u16string(1, u'p');}
    static std::u16string long_name()  {return std::u16string(u"pico");}
    static std::u16string symbol() {return short_name();}
    static std::u16string prefix() {return long_name();}
};

template <>
struct ratio_string<pico, char32_t>
{
    static std::u32string short_name() {return std::u32string(1, U'p');}
    static std::u32string long_name()  {return std::u32string(U"pico");}
    static std::u32string symbol() {return short_name();}
    static std::u32string prefix() {return long_name();}
};

#endif

#ifndef BOOST_NO_STD_WSTRING
template <>
struct ratio_string<pico, wchar_t>
{
    static std::wstring short_name() {return std::wstring(1, L'p');}
    static std::wstring long_name()  {return std::wstring(L"pico");}
    static std::wstring symbol() {return short_name();}
    static std::wstring prefix() {return long_name();}
};
#endif
#endif

// nano

//template <>
//struct ratio_string_is_localizable<nano> : true_type {};
//
//template <>
//struct ratio_string_id<nano> : integral_constant<int,-9> {};

#ifdef BOOST_RATIO_HAS_STATIC_STRING
template <typename CharT>
struct ratio_string<nano, CharT> :
    ratio_detail::ratio_string_static<nano,CharT>
{};

#else
template <>
struct ratio_string<nano, char>
{
    static std::string short_name() {return std::string(1, 'n');}
    static std::string long_name()  {return std::string("nano");}
    static std::string symbol() {return short_name();}
    static std::string prefix() {return long_name();}
};

#if BOOST_RATIO_HAS_UNICODE_SUPPORT

template <>
struct ratio_string<nano, char16_t>
{
    static std::u16string short_name() {return std::u16string(1, u'n');}
    static std::u16string long_name()  {return std::u16string(u"nano");}
    static std::u16string symbol() {return short_name();}
    static std::u16string prefix() {return long_name();}
};

template <>
struct ratio_string<nano, char32_t>
{
    static std::u32string short_name() {return std::u32string(1, U'n');}
    static std::u32string long_name()  {return std::u32string(U"nano");}
    static std::u32string symbol() {return short_name();}
    static std::u32string prefix() {return long_name();}
};

#endif

#ifndef BOOST_NO_STD_WSTRING
template <>
struct ratio_string<nano, wchar_t>
{
    static std::wstring short_name() {return std::wstring(1, L'n');}
    static std::wstring long_name()  {return std::wstring(L"nano");}
    static std::wstring symbol() {return short_name();}
    static std::wstring prefix() {return long_name();}
};
#endif
#endif

// micro

//template <>
//struct ratio_string_is_localizable<micro> : true_type {};
//
//template <>
//struct ratio_string_id<micro> : integral_constant<int,-6> {};

#ifdef BOOST_RATIO_HAS_STATIC_STRING
template <typename CharT>
struct ratio_string<micro, CharT> :
    ratio_detail::ratio_string_static<micro,CharT>
{};

#else
template <>
struct ratio_string<micro, char>
{
    static std::string short_name() {return std::string("\xC2\xB5");}
    static std::string long_name()  {return std::string("micro");}
    static std::string symbol() {return short_name();}
    static std::string prefix() {return long_name();}
};

#if BOOST_RATIO_HAS_UNICODE_SUPPORT

template <>
struct ratio_string<micro, char16_t>
{
    static std::u16string short_name() {return std::u16string(1, u'\xB5');}
    static std::u16string long_name()  {return std::u16string(u"micro");}
    static std::u16string symbol() {return short_name();}
    static std::u16string prefix() {return long_name();}
};

template <>
struct ratio_string<micro, char32_t>
{
    static std::u32string short_name() {return std::u32string(1, U'\xB5');}
    static std::u32string long_name()  {return std::u32string(U"micro");}
    static std::u32string symbol() {return short_name();}
    static std::u32string prefix() {return long_name();}
};

#endif

#ifndef BOOST_NO_STD_WSTRING
template <>
struct ratio_string<micro, wchar_t>
{
    static std::wstring short_name() {return std::wstring(1, L'\xB5');}
    static std::wstring long_name()  {return std::wstring(L"micro");}
    static std::wstring symbol() {return short_name();}
    static std::wstring prefix() {return long_name();}
};
#endif
#endif

// milli

//template <>
//struct ratio_string_is_localizable<milli> : true_type {};
//
//template <>
//struct ratio_string_id<milli> : integral_constant<int,-3> {};

#ifdef BOOST_RATIO_HAS_STATIC_STRING
template <typename CharT>
struct ratio_string<milli, CharT> :
    ratio_detail::ratio_string_static<milli,CharT>
{};

#else
template <>
struct ratio_string<milli, char>
{
    static std::string short_name() {return std::string(1, 'm');}
    static std::string long_name()  {return std::string("milli");}
    static std::string symbol() {return short_name();}
    static std::string prefix() {return long_name();}
};

#if BOOST_RATIO_HAS_UNICODE_SUPPORT

template <>
struct ratio_string<milli, char16_t>
{
    static std::u16string short_name() {return std::u16string(1, u'm');}
    static std::u16string long_name()  {return std::u16string(u"milli");}
    static std::u16string symbol() {return short_name();}
    static std::u16string prefix() {return long_name();}
};

template <>
struct ratio_string<milli, char32_t>
{
    static std::u32string short_name() {return std::u32string(1, U'm');}
    static std::u32string long_name()  {return std::u32string(U"milli");}
    static std::u32string symbol() {return short_name();}
    static std::u32string prefix() {return long_name();}
};

#endif

#ifndef BOOST_NO_STD_WSTRING
template <>
struct ratio_string<milli, wchar_t>
{
    static std::wstring short_name() {return std::wstring(1, L'm');}
    static std::wstring long_name()  {return std::wstring(L"milli");}
    static std::wstring symbol() {return short_name();}
    static std::wstring prefix() {return long_name();}
};
#endif
#endif

// centi

//template <>
//struct ratio_string_is_localizable<centi> : true_type {};
//
//template <>
//struct ratio_string_id<centi> : integral_constant<int,-2> {};

#ifdef BOOST_RATIO_HAS_STATIC_STRING
template <typename CharT>
struct ratio_string<centi, CharT> :
    ratio_detail::ratio_string_static<centi,CharT>
{};

#else
template <>
struct ratio_string<centi, char>
{
    static std::string short_name() {return std::string(1, 'c');}
    static std::string long_name()  {return std::string("centi");}
    static std::string symbol() {return short_name();}
    static std::string prefix() {return long_name();}
};

#if BOOST_RATIO_HAS_UNICODE_SUPPORT

template <>
struct ratio_string<centi, char16_t>
{
    static std::u16string short_name() {return std::u16string(1, u'c');}
    static std::u16string long_name()  {return std::u16string(u"centi");}
    static std::u16string symbol() {return short_name();}
    static std::u16string prefix() {return long_name();}
};

template <>
struct ratio_string<centi, char32_t>
{
    static std::u32string short_name() {return std::u32string(1, U'c');}
    static std::u32string long_name()  {return std::u32string(U"centi");}
    static std::u32string symbol() {return short_name();}
    static std::u32string prefix() {return long_name();}
};

#endif

#ifndef BOOST_NO_STD_WSTRING
template <>
struct ratio_string<centi, wchar_t>
{
    static std::wstring short_name() {return std::wstring(1, L'c');}
    static std::wstring long_name()  {return std::wstring(L"centi");}
    static std::wstring symbol() {return short_name();}
    static std::wstring prefix() {return long_name();}
};
#endif
#endif

// deci

//template <>
//struct ratio_string_is_localizable<deci> : true_type {};
//
//template <>
//struct ratio_string_id<deci> : integral_constant<int,-1> {};

#ifdef BOOST_RATIO_HAS_STATIC_STRING
template <typename CharT>
struct ratio_string<deci, CharT> :
    ratio_detail::ratio_string_static<deci,CharT>
{};

#else

template <>
struct ratio_string<deci, char>
{
    static std::string short_name() {return std::string(1, 'd');}
    static std::string long_name()  {return std::string("deci");}
    static std::string symbol() {return short_name();}
    static std::string prefix() {return long_name();}
};

#if BOOST_RATIO_HAS_UNICODE_SUPPORT

template <>
struct ratio_string<deci, char16_t>
{
    static std::u16string short_name() {return std::u16string(1, u'd');}
    static std::u16string long_name()  {return std::u16string(u"deci");}
    static std::u16string symbol() {return short_name();}
    static std::u16string prefix() {return long_name();}
};

template <>
struct ratio_string<deci, char32_t>
{
    static std::u32string short_name() {return std::u32string(1, U'd');}
    static std::u32string long_name()  {return std::u32string(U"deci");}
    static std::u32string symbol() {return short_name();}
    static std::u32string prefix() {return long_name();}
};

#endif

#ifndef BOOST_NO_STD_WSTRING
template <>
struct ratio_string<deci, wchar_t>
{
    static std::wstring short_name() {return std::wstring(1, L'd');}
    static std::wstring long_name()  {return std::wstring(L"deci");}
    static std::wstring symbol() {return short_name();}
    static std::wstring prefix() {return long_name();}
};
#endif
#endif

// unit

//template <>
//struct ratio_string_is_localizable<ratio<1> > : true_type {};
//
//template <>
//struct ratio_string_id<ratio<1> > : integral_constant<int,0> {};
// deca

//template <>
//struct ratio_string_is_localizable<deca> : true_type {};
//
//template <>
//struct ratio_string_id<deca> : integral_constant<int,1> {};

#ifdef BOOST_RATIO_HAS_STATIC_STRING
template <typename CharT>
struct ratio_string<deca, CharT> :
    ratio_detail::ratio_string_static<deca,CharT>
{};

#else
template <>
struct ratio_string<deca, char>
{
    static std::string short_name() {return std::string("da");}
    static std::string long_name()  {return std::string("deca");}
    static std::string symbol() {return short_name();}
    static std::string prefix() {return long_name();}
};

#if BOOST_RATIO_HAS_UNICODE_SUPPORT

template <>
struct ratio_string<deca, char16_t>
{
    static std::u16string short_name() {return std::u16string(u"da");}
    static std::u16string long_name()  {return std::u16string(u"deca");}
    static std::u16string symbol() {return short_name();}
    static std::u16string prefix() {return long_name();}
};

template <>
struct ratio_string<deca, char32_t>
{
    static std::u32string short_name() {return std::u32string(U"da");}
    static std::u32string long_name()  {return std::u32string(U"deca");}
    static std::u32string symbol() {return short_name();}
    static std::u32string prefix() {return long_name();}
};

#endif

#ifndef BOOST_NO_STD_WSTRING
template <>
struct ratio_string<deca, wchar_t>
{
    static std::wstring short_name() {return std::wstring(L"da");}
    static std::wstring long_name()  {return std::wstring(L"deca");}
    static std::wstring symbol() {return short_name();}
    static std::wstring prefix() {return long_name();}
};
#endif
#endif

// hecto

//template <>
//struct ratio_string_is_localizable<hecto> : true_type {};
//
//template <>
//struct ratio_string_id<hecto> : integral_constant<int,2> {};

#ifdef BOOST_RATIO_HAS_STATIC_STRING
template <typename CharT>
struct ratio_string<hecto, CharT> :
    ratio_detail::ratio_string_static<hecto,CharT>
{};

#else
template <>
struct ratio_string<hecto, char>
{
    static std::string short_name() {return std::string(1, 'h');}
    static std::string long_name()  {return std::string("hecto");}
    static std::string symbol() {return short_name();}
    static std::string prefix() {return long_name();}
};

#if BOOST_RATIO_HAS_UNICODE_SUPPORT

template <>
struct ratio_string<hecto, char16_t>
{
    static std::u16string short_name() {return std::u16string(1, u'h');}
    static std::u16string long_name()  {return std::u16string(u"hecto");}
    static std::u16string symbol() {return short_name();}
    static std::u16string prefix() {return long_name();}
};

template <>
struct ratio_string<hecto, char32_t>
{
    static std::u32string short_name() {return std::u32string(1, U'h');}
    static std::u32string long_name()  {return std::u32string(U"hecto");}
    static std::u32string symbol() {return short_name();}
    static std::u32string prefix() {return long_name();}
};

#endif

#ifndef BOOST_NO_STD_WSTRING
template <>
struct ratio_string<hecto, wchar_t>
{
    static std::wstring short_name() {return std::wstring(1, L'h');}
    static std::wstring long_name()  {return std::wstring(L"hecto");}
    static std::wstring symbol() {return short_name();}
    static std::wstring prefix() {return long_name();}
};
#endif
#endif

// kilo

//template <>
//struct ratio_string_is_localizable<kilo> : true_type {};
//
//template <>
//struct ratio_string_id<kilo> : integral_constant<int,3> {};

#ifdef BOOST_RATIO_HAS_STATIC_STRING
template <typename CharT>
struct ratio_string<kilo, CharT> :
    ratio_detail::ratio_string_static<kilo,CharT>
{};

#else
template <>
struct ratio_string<kilo, char>
{
    static std::string short_name() {return std::string(1, 'k');}
    static std::string long_name()  {return std::string("kilo");}
    static std::string symbol() {return short_name();}
    static std::string prefix() {return long_name();}
};

#if BOOST_RATIO_HAS_UNICODE_SUPPORT

template <>
struct ratio_string<kilo, char16_t>
{
    static std::u16string short_name() {return std::u16string(1, u'k');}
    static std::u16string long_name()  {return std::u16string(u"kilo");}
    static std::u16string symbol() {return short_name();}
    static std::u16string prefix() {return long_name();}
};

template <>
struct ratio_string<kilo, char32_t>
{
    static std::u32string short_name() {return std::u32string(1, U'k');}
    static std::u32string long_name()  {return std::u32string(U"kilo");}
    static std::u32string symbol() {return short_name();}
    static std::u32string prefix() {return long_name();}
};

#endif

#ifndef BOOST_NO_STD_WSTRING
template <>
struct ratio_string<kilo, wchar_t>
{
    static std::wstring short_name() {return std::wstring(1, L'k');}
    static std::wstring long_name()  {return std::wstring(L"kilo");}
    static std::wstring symbol() {return short_name();}
    static std::wstring prefix() {return long_name();}
};
#endif
#endif

// mega

//template <>
//struct ratio_string_is_localizable<mega> : true_type {};
//
//template <>
//struct ratio_string_id<mega> : integral_constant<int,6> {};

#ifdef BOOST_RATIO_HAS_STATIC_STRING
template <typename CharT>
struct ratio_string<mega, CharT> :
    ratio_detail::ratio_string_static<mega,CharT>
{};

#else

template <>
struct ratio_string<mega, char>
{
    static std::string short_name() {return std::string(1, 'M');}
    static std::string long_name()  {return std::string("mega");}
    static std::string symbol() {return short_name();}
    static std::string prefix() {return long_name();}
};

#if BOOST_RATIO_HAS_UNICODE_SUPPORT

template <>
struct ratio_string<mega, char16_t>
{
    static std::u16string short_name() {return std::u16string(1, u'M');}
    static std::u16string long_name()  {return std::u16string(u"mega");}
    static std::u16string symbol() {return short_name();}
    static std::u16string prefix() {return long_name();}
};

template <>
struct ratio_string<mega, char32_t>
{
    static std::u32string short_name() {return std::u32string(1, U'M');}
    static std::u32string long_name()  {return std::u32string(U"mega");}
    static std::u32string symbol() {return short_name();}
    static std::u32string prefix() {return long_name();}
};

#endif

#ifndef BOOST_NO_STD_WSTRING
template <>
struct ratio_string<mega, wchar_t>
{
    static std::wstring short_name() {return std::wstring(1, L'M');}
    static std::wstring long_name()  {return std::wstring(L"mega");}
    static std::wstring symbol() {return short_name();}
    static std::wstring prefix() {return long_name();}
};
#endif
#endif

// giga

//template <>
//struct ratio_string_is_localizable<giga> : true_type {};
//
//template <>
//struct ratio_string_id<giga> : integral_constant<int,9> {};

#ifdef BOOST_RATIO_HAS_STATIC_STRING
template <typename CharT>
struct ratio_string<giga, CharT> :
    ratio_detail::ratio_string_static<giga,CharT>
{};

#else

template <>
struct ratio_string<giga, char>
{
    static std::string short_name() {return std::string(1, 'G');}
    static std::string long_name()  {return std::string("giga");}
    static std::string symbol() {return short_name();}
    static std::string prefix() {return long_name();}
};

#if BOOST_RATIO_HAS_UNICODE_SUPPORT

template <>
struct ratio_string<giga, char16_t>
{
    static std::u16string short_name() {return std::u16string(1, u'G');}
    static std::u16string long_name()  {return std::u16string(u"giga");}
    static std::u16string symbol() {return short_name();}
    static std::u16string prefix() {return long_name();}
};

template <>
struct ratio_string<giga, char32_t>
{
    static std::u32string short_name() {return std::u32string(1, U'G');}
    static std::u32string long_name()  {return std::u32string(U"giga");}
    static std::u32string symbol() {return short_name();}
    static std::u32string prefix() {return long_name();}
};

#endif

#ifndef BOOST_NO_STD_WSTRING
template <>
struct ratio_string<giga, wchar_t>
{
    static std::wstring short_name() {return std::wstring(1, L'G');}
    static std::wstring long_name()  {return std::wstring(L"giga");}
    static std::wstring symbol() {return short_name();}
    static std::wstring prefix() {return long_name();}
};
#endif
#endif

// tera

//template <>
//struct ratio_string_is_localizable<tera> : true_type {};
//
//template <>
//struct ratio_string_id<tera> : integral_constant<int,12> {};

#ifdef BOOST_RATIO_HAS_STATIC_STRING
template <typename CharT>
struct ratio_string<tera, CharT> :
    ratio_detail::ratio_string_static<tera,CharT>
{};

#else
template <>
struct ratio_string<tera, char>
{
    static std::string short_name() {return std::string(1, 'T');}
    static std::string long_name()  {return std::string("tera");}
    static std::string symbol() {return short_name();}
    static std::string prefix() {return long_name();}
};

#if BOOST_RATIO_HAS_UNICODE_SUPPORT

template <>
struct ratio_string<tera, char16_t>
{
    static std::u16string short_name() {return std::u16string(1, u'T');}
    static std::u16string long_name()  {return std::u16string(u"tera");}
    static std::u16string symbol() {return short_name();}
    static std::u16string prefix() {return long_name();}
};

template <>
struct ratio_string<tera, char32_t>
{
    static std::u32string short_name() {return std::u32string(1, U'T');}
    static std::u32string long_name()  {return std::u32string(U"tera");}
    static std::u32string symbol() {return short_name();}
    static std::u32string prefix() {return long_name();}
};

#endif

#ifndef BOOST_NO_STD_WSTRING
template <>
struct ratio_string<tera, wchar_t>
{
    static std::wstring short_name() {return std::wstring(1, L'T');}
    static std::wstring long_name()  {return std::wstring(L"tera");}
    static std::wstring symbol() {return short_name();}
    static std::wstring prefix() {return long_name();}
};
#endif
#endif

// peta

//template <>
//struct ratio_string_is_localizable<peta> : true_type {};
//
//template <>
//struct ratio_string_id<peta> : integral_constant<int,15> {};

#ifdef BOOST_RATIO_HAS_STATIC_STRING
template <typename CharT>
struct ratio_string<peta, CharT> :
    ratio_detail::ratio_string_static<peta,CharT>
{};

#else
template <>
struct ratio_string<peta, char>
{
    static std::string short_name() {return std::string(1, 'P');}
    static std::string long_name()  {return std::string("peta");}
    static std::string symbol() {return short_name();}
    static std::string prefix() {return long_name();}
};

#if BOOST_RATIO_HAS_UNICODE_SUPPORT

template <>
struct ratio_string<peta, char16_t>
{
    static std::u16string short_name() {return std::u16string(1, u'P');}
    static std::u16string long_name()  {return std::u16string(u"peta");}
    static std::u16string symbol() {return short_name();}
    static std::u16string prefix() {return long_name();}
};

template <>
struct ratio_string<peta, char32_t>
{
    static std::u32string short_name() {return std::u32string(1, U'P');}
    static std::u32string long_name()  {return std::u32string(U"peta");}
    static std::u32string symbol() {return short_name();}
    static std::u32string prefix() {return long_name();}
};

#endif

#ifndef BOOST_NO_STD_WSTRING
template <>
struct ratio_string<peta, wchar_t>
{
    static std::wstring short_name() {return std::wstring(1, L'P');}
    static std::wstring long_name()  {return std::wstring(L"peta");}
    static std::wstring symbol() {return short_name();}
    static std::wstring prefix() {return long_name();}
};
#endif
#endif

// exa

//template <>
//struct ratio_string_is_localizable<exa> : true_type {};
//
//template <>
//struct ratio_string_id<exa> : integral_constant<int,18> {};

#ifdef BOOST_RATIO_HAS_STATIC_STRING
template <typename CharT>
struct ratio_string<exa, CharT> :
    ratio_detail::ratio_string_static<exa,CharT>
{};

#else
template <>
struct ratio_string<exa, char>
{
    static std::string short_name() {return std::string(1, 'E');}
    static std::string long_name()  {return std::string("exa");}
    static std::string symbol() {return short_name();}
    static std::string prefix() {return long_name();}
};

#if BOOST_RATIO_HAS_UNICODE_SUPPORT

template <>
struct ratio_string<exa, char16_t>
{
    static std::u16string short_name() {return std::u16string(1, u'E');}
    static std::u16string long_name()  {return std::u16string(u"exa");}
    static std::u16string symbol() {return short_name();}
    static std::u16string prefix() {return long_name();}
};

template <>
struct ratio_string<exa, char32_t>
{
    static std::u32string short_name() {return std::u32string(1, U'E');}
    static std::u32string long_name()  {return std::u32string(U"exa");}
    static std::u32string symbol() {return short_name();}
    static std::u32string prefix() {return long_name();}
};

#endif

#ifndef BOOST_NO_STD_WSTRING
template <>
struct ratio_string<exa, wchar_t>
{
    static std::wstring short_name() {return std::wstring(1, L'E');}
    static std::wstring long_name()  {return std::wstring(L"exa");}
    static std::wstring symbol() {return short_name();}
    static std::wstring prefix() {return long_name();}
};
#endif
#endif

#ifdef BOOST_RATIO_EXTENSIONS

#ifdef BOOST_RATIO_HAS_STATIC_STRING
template <typename CharT>
struct ratio_string<kibi, CharT> :
    ratio_detail::ratio_string_static<kibi,CharT>
{};

#else
template <>
struct ratio_string<kibi, char>
{
    static std::string short_name() {return std::string("Ki");}
    static std::string long_name()  {return std::string("kibi");}
    static std::string symbol() {return short_name();}
    static std::string prefix() {return long_name();}
};

#if BOOST_RATIO_HAS_UNICODE_SUPPORT

template <>
struct ratio_string<kibi, char16_t>
{
    static std::u16string short_name() {return std::u16string(u"Ki");}
    static std::u16string long_name()  {return std::u16string(u"kibi");}
    static std::u16string symbol() {return short_name();}
    static std::u16string prefix() {return long_name();}
};

template <>
struct ratio_string<kibi, char32_t>
{
    static std::u32string short_name() {return std::u32string(U"Ki");}
    static std::u32string long_name()  {return std::u32string(U"kibi");}
    static std::u32string symbol() {return short_name();}
    static std::u32string prefix() {return long_name();}
};

#endif

#ifndef BOOST_NO_STD_WSTRING
template <>
struct ratio_string<kibi, wchar_t>
{
    static std::wstring short_name() {return std::wstring(L"Ki");}
    static std::wstring long_name()  {return std::wstring(L"kibi");}
    static std::wstring symbol() {return short_name();}
    static std::wstring prefix() {return long_name();}
};
#endif
#endif

#ifdef BOOST_RATIO_HAS_STATIC_STRING
template <typename CharT>
struct ratio_string<mebi, CharT> :
    ratio_detail::ratio_string_static<mebi,CharT>
{};

#else
template <>
struct ratio_string<mebi, char>
{
    static std::string short_name() {return std::string("Mi");}
    static std::string long_name()  {return std::string("mebi");}
    static std::string symbol() {return short_name();}
    static std::string prefix() {return long_name();}
};

#if BOOST_RATIO_HAS_UNICODE_SUPPORT

template <>
struct ratio_string<mebi, char16_t>
{
    static std::u16string short_name() {return std::u16string(u"Mi");}
    static std::u16string long_name()  {return std::u16string(u"mebi");}
    static std::u16string symbol() {return short_name();}
    static std::u16string prefix() {return long_name();}
};

template <>
struct ratio_string<mebi, char32_t>
{
    static std::u32string short_name() {return std::u32string(U"Mi");}
    static std::u32string long_name()  {return std::u32string(U"mebi");}
    static std::u32string symbol() {return short_name();}
    static std::u32string prefix() {return long_name();}
};

#endif

#ifndef BOOST_NO_STD_WSTRING
template <>
struct ratio_string<mebi, wchar_t>
{
    static std::wstring short_name() {return std::wstring(L"Mi");}
    static std::wstring long_name()  {return std::wstring(L"mebi");}
    static std::wstring symbol() {return short_name();}
    static std::wstring prefix() {return long_name();}
};
#endif
#endif

#ifdef BOOST_RATIO_HAS_STATIC_STRING
template <typename CharT>
struct ratio_string<gibi, CharT> :
    ratio_detail::ratio_string_static<gibi,CharT>
{};

#else
template <>
struct ratio_string<gibi, char>
{
    static std::string short_name() {return std::string("Gi");}
    static std::string long_name()  {return std::string("gibi");}
    static std::string symbol() {return short_name();}
    static std::string prefix() {return long_name();}
};

#if BOOST_RATIO_HAS_UNICODE_SUPPORT

template <>
struct ratio_string<gibi, char16_t>
{
    static std::u16string short_name() {return std::u16string(u"Gi");}
    static std::u16string long_name()  {return std::u16string(u"gibi");}
    static std::u16string symbol() {return short_name();}
    static std::u16string prefix() {return long_name();}
};

template <>
struct ratio_string<gibi, char32_t>
{
    static std::u32string short_name() {return std::u32string(U"Gi");}
    static std::u32string long_name()  {return std::u32string(U"gibi");}
    static std::u32string symbol() {return short_name();}
    static std::u32string prefix() {return long_name();}
};

#endif

#ifndef BOOST_NO_STD_WSTRING
template <>
struct ratio_string<gibi, wchar_t>
{
    static std::wstring short_name() {return std::wstring(L"Gi");}
    static std::wstring long_name()  {return std::wstring(L"gibi");}
    static std::wstring symbol() {return short_name();}
    static std::wstring prefix() {return long_name();}
};
#endif
#endif

#ifdef BOOST_RATIO_HAS_STATIC_STRING
template <typename CharT>
struct ratio_string<tebi, CharT> :
    ratio_detail::ratio_string_static<tebi,CharT>
{};

#else
template <>
struct ratio_string<tebi, char>
{
    static std::string short_name() {return std::string("Ti");}
    static std::string long_name()  {return std::string("tebi");}
    static std::string symbol() {return short_name();}
    static std::string prefix() {return long_name();}
};

#if BOOST_RATIO_HAS_UNICODE_SUPPORT

template <>
struct ratio_string<tebi, char16_t>
{
    static std::u16string short_name() {return std::u16string(u"Ti");}
    static std::u16string long_name()  {return std::u16string(u"tebi");}
    static std::u16string symbol() {return short_name();}
    static std::u16string prefix() {return long_name();}
};

template <>
struct ratio_string<tebi, char32_t>
{
    static std::u32string short_name() {return std::u32string(U"Ti");}
    static std::u32string long_name()  {return std::u32string(U"tebi");}
    static std::u32string symbol() {return short_name();}
    static std::u32string prefix() {return long_name();}
};

#endif

#ifndef BOOST_NO_STD_WSTRING
template <>
struct ratio_string<tebi, wchar_t>
{
    static std::wstring short_name() {return std::wstring(L"Ti");}
    static std::wstring long_name()  {return std::wstring(L"tebi");}
    static std::wstring symbol() {return short_name();}
    static std::wstring prefix() {return long_name();}
};
#endif
#endif

#ifdef BOOST_RATIO_HAS_STATIC_STRING
template <typename CharT>
struct ratio_string<pebi, CharT> :
    ratio_detail::ratio_string_static<pebi,CharT>
{};

#else
template <>
struct ratio_string<pebi, char>
{
    static std::string short_name() {return std::string("Pi");}
    static std::string long_name()  {return std::string("pebi");}
    static std::string symbol() {return short_name();}
    static std::string prefix() {return long_name();}
};

#if BOOST_RATIO_HAS_UNICODE_SUPPORT

template <>
struct ratio_string<pebi, char16_t>
{
    static std::u16string short_name() {return std::u16string(u"Pi");}
    static std::u16string long_name()  {return std::u16string(u"pebi");}
    static std::u16string symbol() {return short_name();}
    static std::u16string prefix() {return long_name();}
};

template <>
struct ratio_string<pebi, char32_t>
{
    static std::u32string short_name() {return std::u32string(U"Pi");}
    static std::u32string long_name()  {return std::u32string(U"pebi");}
    static std::u32string symbol() {return short_name();}
    static std::u32string prefix() {return long_name();}
};

#endif

#ifndef BOOST_NO_STD_WSTRING
template <>
struct ratio_string<pebi, wchar_t>
{
    static std::wstring short_name() {return std::wstring(L"Pi");}
    static std::wstring long_name()  {return std::wstring(L"pebi");}
    static std::wstring symbol() {return short_name();}
    static std::wstring prefix() {return long_name();}
};
#endif
#endif

#ifdef BOOST_RATIO_HAS_STATIC_STRING
template <typename CharT>
struct ratio_string<exbi, CharT> :
    ratio_detail::ratio_string_static<exbi,CharT>
{};

#else
template <>
struct ratio_string<exbi, char>
{
    static std::string short_name() {return std::string("Ei");}
    static std::string long_name()  {return std::string("exbi");}
    static std::string symbol() {return short_name();}
    static std::string prefix() {return long_name();}
};

#if BOOST_RATIO_HAS_UNICODE_SUPPORT

template <>
struct ratio_string<exbi, char16_t>
{
    static std::u16string short_name() {return std::u16string(u"Ei");}
    static std::u16string long_name()  {return std::u16string(u"exbi");}
    static std::u16string symbol() {return short_name();}
    static std::u16string prefix() {return long_name();}
};

template <>
struct ratio_string<exbi, char32_t>
{
    static std::u32string short_name() {return std::u32string(U"Ei");}
    static std::u32string long_name()  {return std::u32string(U"exbi");}
    static std::u32string symbol() {return short_name();}
    static std::u32string prefix() {return long_name();}
};

#endif

#ifndef BOOST_NO_STD_WSTRING
template <>
struct ratio_string<exbi, wchar_t>
{
    static std::wstring short_name() {return std::wstring(L"Ei");}
    static std::wstring long_name()  {return std::wstring(L"exbi");}
    static std::wstring symbol() {return short_name();}
    static std::wstring prefix() {return long_name();}
};
#endif
#endif
#endif
}

#endif  // BOOST_RATIO_RATIO_IO_HPP


code:
// Boost.Range library
//
//  Copyright Thorsten Ottosen 2003-2004. Use, modification and
//  distribution is subject to 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)
//
// For more information, see http://www.boost.org/libs/range/
//

#ifndef BOOST_RANGE_DETAIL_VALUE_TYPE_HPP
#define BOOST_RANGE_DETAIL_VALUE_TYPE_HPP

#include <boost/range/detail/common.hpp>
#include <boost/range/detail/remove_extent.hpp>
#include <boost/iterator/iterator_traits.hpp>

//////////////////////////////////////////////////////////////////////////////
// missing partial specialization  workaround.
//////////////////////////////////////////////////////////////////////////////

namespace boost
{
    namespace range_detail
    {
        template< typename T >
        struct range_value_type_;

        template<>
        struct range_value_type_<std_container_>
        {
            template< typename C >
            struct pts
            {
                typedef BOOST_RANGE_DEDUCED_TYPENAME C::value_type type;
            };
        };

        template<>
        struct range_value_type_<std_pair_>
        {
            template< typename P >
            struct pts
            {
                typedef BOOST_RANGE_DEDUCED_TYPENAME boost::iterator_value< BOOST_RANGE_DEDUCED_TYPENAME P::first_type >::type type;
            };
        };

        template<>
        struct range_value_type_<array_>
        {
            template< typename T >
            struct pts
            {
                typedef BOOST_DEDUCED_TYPENAME remove_extent<T>::type type;
            };
        };

    }

    template< typename C >
    class range_value
    {
        typedef BOOST_DEDUCED_TYPENAME range_detail::range<C>::type c_type;
    public:
        typedef BOOST_DEDUCED_TYPENAME range_detail::range_value_type_<c_type>::BOOST_NESTED_TEMPLATE pts<C>::type type;
    };

}

#endif


code:
//  (C) Copyright Gennadiy Rozental 2001.
//  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/libs/test for the library home page.
//
/// @file
/// Provides core implementation for Unit Test Framework.
/// Extensions can be provided in separate files
// ***************************************************************************

#ifndef BOOST_TEST_UNIT_TEST_SUITE_IPP_012205GER
#define BOOST_TEST_UNIT_TEST_SUITE_IPP_012205GER

// Boost.Test
#include <boost/detail/workaround.hpp>

#include <boost/test/framework.hpp>
#include <boost/test/results_collector.hpp>

#include <boost/test/tree/test_unit.hpp>
#include <boost/test/tree/visitor.hpp>
#include <boost/test/tree/traverse.hpp>
#include <boost/test/tree/auto_registration.hpp>
#include <boost/test/tree/global_fixture.hpp>

#include <boost/test/utils/foreach.hpp>
#include <boost/test/utils/basic_cstring/io.hpp>

#include <boost/test/unit_test_parameters.hpp>

// Boost
#include <boost/timer.hpp>

// STL
#include <algorithm>
#include <vector>

#include <boost/test/detail/suppress_warnings.hpp>

//____________________________________________________________________________//

namespace boost {
namespace unit_test {

// ************************************************************************** //
// **************                   test_unit                  ************** //
// ************************************************************************** //

test_unit::test_unit( const_string name, const_string file_name, std::size_t line_num, test_unit_type t )
: p_type( t )
, p_type_name( t == TUT_CASE ? "case" : "suite" )
, p_file_name( file_name )
, p_line_num( line_num )
, p_id( INV_TEST_UNIT_ID )
, p_parent_id( INV_TEST_UNIT_ID )
, p_name( std::string( name.begin(), name.size() ) )
, p_timeout( 0 )
, p_expected_failures( 0 )
, p_default_status( RS_INHERIT )
, p_run_status( RS_INVALID )
, p_sibling_rank(0)
{
}

//____________________________________________________________________________//

test_unit::test_unit( const_string module_name )
: p_type( TUT_SUITE )
, p_type_name( "module" )
, p_line_num( 0 )
, p_id( INV_TEST_UNIT_ID )
, p_parent_id( INV_TEST_UNIT_ID )
, p_name( std::string( module_name.begin(), module_name.size() ) )
, p_timeout( 0 )
, p_expected_failures( 0 )
, p_default_status( RS_INHERIT )
, p_run_status( RS_INVALID )
, p_sibling_rank(0)
{
}

//____________________________________________________________________________//

test_unit::~test_unit()
{
    framework::deregister_test_unit( this );
}

//____________________________________________________________________________//

void
test_unit::depends_on( test_unit* tu )
{
    BOOST_TEST_SETUP_ASSERT( p_id != framework::master_test_suite().p_id,
                             "Can't add dependency to the master test suite" );

    p_dependencies.value.push_back( tu->p_id );
}

//____________________________________________________________________________//

void
test_unit::add_precondition( precondition_t const& pc )
{
    p_preconditions.value.push_back( pc );
}

//____________________________________________________________________________//

test_tools::assertion_result
test_unit::check_preconditions() const
{
    BOOST_TEST_FOREACH( test_unit_id, dep_id, p_dependencies.get() ) {
        test_unit const& dep = framework::get( dep_id, TUT_ANY );

        if( !dep.is_enabled() ) {
            test_tools::assertion_result res(false);
            res.message() << "dependency test " << dep.p_type_name << " \"" << dep.full_name() << "\" is disabled";
            return res;
        }

        test_results const& test_rslt = unit_test::results_collector.results( dep_id );
        if( !test_rslt.passed() ) {
            test_tools::assertion_result res(false);
            res.message() << "dependency test " << dep.p_type_name << " \"" << dep.full_name() << "\" has failed";
            return res;
        }

        if( test_rslt.p_test_cases_skipped > 0 ) {
            test_tools::assertion_result res(false);
            res.message() << "dependency test " << dep.p_type_name << " \"" << dep.full_name() << "\" has skipped test cases";
            return res;
        }
    }

    BOOST_TEST_FOREACH( precondition_t, precondition, p_preconditions.get() ) {
        test_tools::assertion_result res = precondition( p_id );
        if( !res ) {
            test_tools::assertion_result res_out(false);
            res_out.message() << "precondition failed";
            if( !res.has_empty_message() )
                res_out.message() << ": " << res.message();
            return res_out;
        }
    }

    return true;
}

//____________________________________________________________________________//

void
test_unit::increase_exp_fail( counter_t num )
{
    p_expected_failures.value += num;

    if( p_parent_id != INV_TEST_UNIT_ID )
        framework::get<test_suite>( p_parent_id ).increase_exp_fail( num );
}

//____________________________________________________________________________//

std::string
test_unit::full_name() const
{
    if( p_parent_id == INV_TEST_UNIT_ID || p_parent_id == framework::master_test_suite().p_id )
        return p_name;

    std::string res = framework::get<test_suite>( p_parent_id ).full_name();
    res.append("/");

    res.append( p_name );

    return res;
}

//____________________________________________________________________________//

void
test_unit::add_label( const_string l )
{
    p_labels.value.push_back( std::string() + l );
}

//____________________________________________________________________________//

bool
test_unit::has_label( const_string l ) const
{
    return std::find( p_labels->begin(), p_labels->end(), l ) != p_labels->end();
}

//____________________________________________________________________________//

// ************************************************************************** //
// **************                   test_case                  ************** //
// ************************************************************************** //

test_case::test_case( const_string name, boost::function<void ()> const& test_func )
: test_unit( name, "", 0, static_cast<test_unit_type>(type) )
, p_test_func( test_func )
{
    framework::register_test_unit( this );
}

//____________________________________________________________________________//

test_case::test_case( const_string name, const_string file_name, std::size_t line_num, boost::function<void ()> const& test_func )
: test_unit( name, file_name, line_num, static_cast<test_unit_type>(type) )
, p_test_func( test_func )
{
    framework::register_test_unit( this );
}

//____________________________________________________________________________//

// ************************************************************************** //
// **************                  test_suite                  ************** //
// ************************************************************************** //

//____________________________________________________________________________//

test_suite::test_suite( const_string name, const_string file_name, std::size_t line_num )
: test_unit( name, file_name, line_num, static_cast<test_unit_type>(type) )
{
    framework::register_test_unit( this );
}

//____________________________________________________________________________//

test_suite::test_suite( const_string module_name )
: test_unit( module_name )
{
    framework::register_test_unit( this );
}

//____________________________________________________________________________//

void
test_suite::add( test_unit* tu, counter_t expected_failures, unsigned timeout )
{
    tu->p_timeout.value = timeout;

    m_children.push_back( tu->p_id );
    tu->p_parent_id.value = p_id;

    if( tu->p_expected_failures != 0 )
        increase_exp_fail( tu->p_expected_failures );

    if( expected_failures )
        tu->increase_exp_fail( expected_failures );
}

//____________________________________________________________________________//

void
test_suite::add( test_unit_generator const& gen, unsigned timeout )
{
    test_unit* tu;
    while((tu = gen.next()) != 0)
        add( tu, 0, timeout );
}

//____________________________________________________________________________//

void
test_suite::add( test_unit_generator const& gen, decorator::collector& decorators )
{
    test_unit* tu;
    while((tu = gen.next()) != 0) {
        decorators.store_in( *tu );
        add( tu, 0 );
    }

    decorators.reset();
}

//____________________________________________________________________________//

void
test_suite::remove( test_unit_id id )
{
    test_unit_id_list::iterator it = std::find( m_children.begin(), m_children.end(), id );

    if( it != m_children.end() )
        m_children.erase( it );
}

//____________________________________________________________________________//

test_unit_id
test_suite::get( const_string tu_name ) const
{
    BOOST_TEST_FOREACH( test_unit_id, id, m_children ) {
        if( tu_name == framework::get( id, ut_detail::test_id_2_unit_type( id ) ).p_name.get() )
            return id;
    }

    return INV_TEST_UNIT_ID;
}

//____________________________________________________________________________//

// ************************************************************************** //
// **************               master_test_suite              ************** //
// ************************************************************************** //

master_test_suite_t::master_test_suite_t()
: test_suite( "Master Test Suite" )
, argc( 0 )
, argv( 0 )
{
    p_default_status.value = RS_ENABLED;
}

// ************************************************************************** //
// **************               traverse_test_tree             ************** //
// ************************************************************************** //

void
traverse_test_tree( test_case const& tc, test_tree_visitor& V, bool ignore_status )
{
    if( tc.is_enabled() || ignore_status )
        V.visit( tc );
}

//____________________________________________________________________________//

void
traverse_test_tree( test_suite const& suite, test_tree_visitor& V, bool ignore_status )
{
    // skip disabled test suite unless we asked to ignore this condition
    if( !ignore_status && !suite.is_enabled() )
        return;

    // Invoke test_suite_start callback
    if( !V.test_suite_start( suite ) )
        return;

    // Recurse into children
    std::size_t total_children = suite.m_children.size();
    for( std::size_t i=0; i < total_children; ) {
        // this statement can remove the test unit from this list
        traverse_test_tree( suite.m_children[i], V, ignore_status );
        if( total_children > suite.m_children.size() )
            total_children = suite.m_children.size();
        else
            ++i;
    }

    // Invoke test_suite_finish callback
    V.test_suite_finish( suite );
}

//____________________________________________________________________________//

void
traverse_test_tree( test_unit_id id, test_tree_visitor& V, bool ignore_status )
{
    if( ut_detail::test_id_2_unit_type( id ) == TUT_CASE )
        traverse_test_tree( framework::get<test_case>( id ), V, ignore_status );
    else
        traverse_test_tree( framework::get<test_suite>( id ), V, ignore_status );
}

//____________________________________________________________________________//

// ************************************************************************** //
// **************               object generators              ************** //
// ************************************************************************** //

namespace ut_detail {

std::string
normalize_test_case_name( const_string name )
{
    std::string norm_name( name.begin(), name.size() );

    if( name[0] == '&' )
        norm_name = norm_name.substr( 1 );

    std::replace(norm_name.begin(), norm_name.end(), ' ', '_');
    std::replace(norm_name.begin(), norm_name.end(), ':', '_');

    return norm_name;
}

//____________________________________________________________________________//

// ************************************************************************** //
// **************           auto_test_unit_registrar           ************** //
// ************************************************************************** //

auto_test_unit_registrar::auto_test_unit_registrar( test_case* tc, decorator::collector& decorators, counter_t exp_fail )
{
    framework::current_auto_test_suite().add( tc, exp_fail );

    decorators.store_in( *tc );
    decorators.reset();
}

//____________________________________________________________________________//

auto_test_unit_registrar::auto_test_unit_registrar( const_string ts_name, const_string ts_file, std::size_t ts_line, decorator::collector& decorators )
{
    test_unit_id id = framework::current_auto_test_suite().get( ts_name );

    test_suite* ts;

    if( id != INV_TEST_UNIT_ID ) {
        ts = &framework::get<test_suite>( id );
        BOOST_ASSERT( ts->p_parent_id == framework::current_auto_test_suite().p_id );
    }
    else {
        ts = new test_suite( ts_name, ts_file, ts_line );
        framework::current_auto_test_suite().add( ts );
    }

    decorators.store_in( *ts );
    decorators.reset();

    framework::current_auto_test_suite( ts );
}

//____________________________________________________________________________//

auto_test_unit_registrar::auto_test_unit_registrar( test_unit_generator const& tc_gen, decorator::collector& decorators )
{
    framework::current_auto_test_suite().add( tc_gen, decorators );
}

//____________________________________________________________________________//

auto_test_unit_registrar::auto_test_unit_registrar( int )
{
    framework::current_auto_test_suite( 0, false );
}

//____________________________________________________________________________//

} // namespace ut_detail

// ************************************************************************** //
// **************                global_fixture                ************** //
// ************************************************************************** //

global_fixture::global_fixture()
{
    framework::register_observer( *this );
}

//____________________________________________________________________________//

} // namespace unit_test
} // namespace boost

#include <boost/test/detail/enable_warnings.hpp>

#endif // BOOST_TEST_UNIT_TEST_SUITE_IPP_012205GER


code:
// Copyright Kevlin Henney, 2000-2005.
// Copyright Alexander Nasonov, 2006-2010.
// Copyright Antony Polukhin, 2011-2014.
//
// 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)
//
// what:  lexical_cast custom keyword cast
// who:   contributed by Kevlin Henney,
//        enhanced with contributions from Terje Slettebo,
//        with additional fixes and suggestions from Gennaro Prota,
//        Beman Dawes, Dave Abrahams, Daryle Walker, Peter Dimov,
//        Alexander Nasonov, Antony Polukhin, Justin Viiret, Michael Hofmann,
//        Cheng Yang, Matthew Bradbury, David W. Birdsall, Pavel Korzh and other Boosters
// when:  November 2000, March 2003, June 2005, June 2006, March 2011 - 2014

#ifndef BOOST_LEXICAL_CAST_BAD_LEXICAL_CAST_HPP
#define BOOST_LEXICAL_CAST_BAD_LEXICAL_CAST_HPP

#include <boost/config.hpp>
#ifdef BOOST_HAS_PRAGMA_ONCE
#   pragma once
#endif

#include <typeinfo>
#include <exception>
#include <boost/throw_exception.hpp>

namespace boost
{
    // exception used to indicate runtime lexical_cast failure
    class BOOST_SYMBOL_VISIBLE bad_lexical_cast :
    // workaround MSVC bug with std::bad_cast when _HAS_EXCEPTIONS == 0
#if defined(BOOST_MSVC) && defined(_HAS_EXCEPTIONS) && !_HAS_EXCEPTIONS
        public std::exception
#else
        public std::bad_cast
#endif

#if defined(__BORLANDC__) && BOOST_WORKAROUND( __BORLANDC__, < 0x560 )
        // under bcc32 5.5.1 bad_cast doesn't derive from exception
        , public std::exception
#endif

    {
    public:
        bad_lexical_cast() BOOST_NOEXCEPT
#ifndef BOOST_NO_TYPEID
           : source(&typeid(void)), target(&typeid(void))
#endif
        {}

        virtual const char *what() const BOOST_NOEXCEPT_OR_NOTHROW {
            return "bad lexical cast: "
                   "source type value could not be interpreted as target";
        }

        virtual ~bad_lexical_cast() BOOST_NOEXCEPT_OR_NOTHROW
        {}

#ifndef BOOST_NO_TYPEID
        bad_lexical_cast(
                const std::type_info &source_type_arg,
                const std::type_info &target_type_arg) BOOST_NOEXCEPT
            : source(&source_type_arg), target(&target_type_arg)
        {}

        const std::type_info &source_type() const BOOST_NOEXCEPT {
            return *source;
        }

        const std::type_info &target_type() const BOOST_NOEXCEPT {
            return *target;
        }

    private:
        const std::type_info *source;
        const std::type_info *target;
#endif
    };

    namespace conversion { namespace detail {
#ifdef BOOST_NO_TYPEID
        template <class S, class T>
        inline void throw_bad_cast() {
            boost::throw_exception(bad_lexical_cast());
        }
#else
        template <class S, class T>
        inline void throw_bad_cast() {
            boost::throw_exception(bad_lexical_cast(typeid(S), typeid(T)));
        }
#endif
    }} // namespace conversion::detail

} // namespace boost

#endif // BOOST_LEXICAL_CAST_BAD_LEXICAL_CAST_HPP


code:
// Copyright David Abrahams 2002.
// 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)
#ifndef INSTANCE_DWA200295_HPP
# define INSTANCE_DWA200295_HPP

# include <boost/python/detail/prefix.hpp>
# include <boost/type_traits/alignment_traits.hpp>
# include <cstddef>

namespace boost { namespace python
{
  struct BOOST_PYTHON_DECL_FORWARD instance_holder;
}} // namespace boost::python

namespace boost { namespace python { namespace objects {

// Each extension instance will be one of these
template <class Data = char>
struct instance
{
    PyObject_VAR_HEAD
    PyObject* dict;
    PyObject* weakrefs;
    instance_holder* objects;

    typedef typename type_with_alignment<
        ::boost::alignment_of<Data>::value
    >::type align_t;

    union
    {
        align_t align;
        char bytes[sizeof(Data)];
    } storage;
};

template <class Data>
struct additional_instance_size
{
    typedef instance<Data> instance_data;
    typedef instance<char> instance_char;
    BOOST_STATIC_CONSTANT(
        std::size_t, value = sizeof(instance_data)
                           - BOOST_PYTHON_OFFSETOF(instance_char,storage));
};

}}} // namespace boost::python::object

#endif // INSTANCE_DWA200295_HPP


code:
// Copyright David Abrahams 2002.
// 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)
#ifndef OBJECT_MANAGER_DWA2002614_HPP
# define OBJECT_MANAGER_DWA2002614_HPP

# include <boost/python/handle.hpp>
# include <boost/python/cast.hpp>
# include <boost/python/converter/pyobject_traits.hpp>
# include <boost/type_traits/object_traits.hpp>
# include <boost/mpl/if.hpp>
# include <boost/python/detail/indirect_traits.hpp>
# include <boost/mpl/bool.hpp>

// Facilities for dealing with types which always manage Python
// objects. Some examples are object, list, str, et. al. Different
// to_python/from_python conversion rules apply here because in
// contrast to other types which are typically embedded inside a
// Python object, these are wrapped around a Python object. For most
// object managers T, a C++ non-const T reference argument does not
// imply the existence of a T lvalue embedded in the corresponding
// Python argument, since mutating member functions on T actually only
// modify the held Python object.
//
// handle<T> is an object manager, though strictly speaking it should
// not be. In other words, even though mutating member functions of
// hanlde<T> actually modify the handle<T> and not the T object,
// handle<T>& arguments of wrapped functions will bind to "rvalues"
// wrapping the actual Python argument, just as with other object
// manager classes. Making an exception for handle<T> is simply not
// worth the trouble.
//
// borrowed<T> cv* is an object manager so that we can use the general
// to_python mechanisms to convert raw Python object pointers to
// python, without the usual semantic problems of using raw pointers.

// Object Manager Concept requirements:
//
//    T is an Object Manager
//    p is a PyObject*
//    x is a T
//
//    * object_manager_traits<T>::is_specialized == true
//
//    * T(detail::borrowed_reference(p))
//        Manages p without checking its type
//
//    * get_managed_object(x, boost::python::tag)
//        Convertible to PyObject*
//
// Additional requirements if T can be converted from_python:
//
//    * T(object_manager_traits<T>::adopt(p))
//        steals a reference to p, or throws a TypeError exception if
//        p doesn't have an appropriate type. May assume p is non-null
//
//    * X::check(p)
//        convertible to bool. True iff T(X::construct(p)) will not
//        throw.

// Forward declarations
//
namespace boost { namespace python
{
  namespace api
  {
    class object;
  }
}}

namespace boost { namespace python { namespace converter {

// Specializations for handle<T>
template <class T>
struct handle_object_manager_traits
    : pyobject_traits<typename T::element_type>
{
 private:
  typedef pyobject_traits<typename T::element_type> base;

 public:
  BOOST_STATIC_CONSTANT(bool, is_specialized = true);

  // Initialize with a null_ok pointer for efficiency, bypassing the
  // null check since the source is always non-null.
  static null_ok<typename T::element_type>* adopt(PyObject* p)
  {
      return python::allow_null(base::checked_downcast(p));
  }
};

template <class T>
struct default_object_manager_traits
{
    BOOST_STATIC_CONSTANT(
        bool, is_specialized = python::detail::is_borrowed_ptr<T>::value
        );
};

template <class T>
struct object_manager_traits
    : mpl::if_c<
         is_handle<T>::value
       , handle_object_manager_traits<T>
       , default_object_manager_traits<T>
    >::type
{
};

//
// Traits for detecting whether a type is an object manager or a
// (cv-qualified) reference to an object manager.
//

template <class T>
struct is_object_manager
    : mpl::bool_<object_manager_traits<T>::is_specialized>
{
};

template <class T>
struct is_reference_to_object_manager
    : mpl::false_
{
};

template <class T>
struct is_reference_to_object_manager<T&>
    : is_object_manager<T>
{
};

template <class T>
struct is_reference_to_object_manager<T const&>
    : is_object_manager<T>
{
};

template <class T>
struct is_reference_to_object_manager<T volatile&>
    : is_object_manager<T>
{
};

template <class T>
struct is_reference_to_object_manager<T const volatile&>
    : is_object_manager<T>
{
};

}}} // namespace boost::python::converter

#endif // OBJECT_MANAGER_DWA2002614_HPP


code:
/*
 * Copyright (c) 2014 Glen Fernandes
 *
 * 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)
 */

#ifndef BOOST_CHECKED_DELETE_HPP
#define BOOST_CHECKED_DELETE_HPP

// The header file at this path is deprecated;
// use boost/core/checked_delete.hpp instead.

#include <boost/core/checked_delete.hpp>

#endif


code:
//  Copyright Neil Groves 2009. Use, modification and
//  distribution is subject to 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)
//
//
// For more information, see http://www.boost.org/libs/range/
//
#ifndef BOOST_RANGE_ALGORITHM_UNIQUE_COPY_HPP_INCLUDED
#define BOOST_RANGE_ALGORITHM_UNIQUE_COPY_HPP_INCLUDED

#include <boost/concept_check.hpp>
#include <boost/range/begin.hpp>
#include <boost/range/end.hpp>
#include <boost/range/concepts.hpp>
#include <algorithm>

namespace boost
{
    namespace range
    {

/// \brief template function unique_copy
///
/// range-based version of the unique_copy std algorithm
///
/// \pre SinglePassRange is a model of the SinglePassRangeConcept
/// \pre OutputIterator is a model of the OutputIteratorConcept
/// \pre BinaryPredicate is a model of the BinaryPredicateConcept
template< class SinglePassRange, class OutputIterator >
inline OutputIterator
unique_copy( const SinglePassRange& rng, OutputIterator out_it )
{
    BOOST_RANGE_CONCEPT_ASSERT(( SinglePassRangeConcept<const SinglePassRange> ));
    return std::unique_copy(boost::begin(rng), boost::end(rng), out_it);
}
/// \overload
template< class SinglePassRange, class OutputIterator, class BinaryPredicate >
inline OutputIterator
unique_copy( const SinglePassRange& rng, OutputIterator out_it,
             BinaryPredicate pred )
{
    BOOST_RANGE_CONCEPT_ASSERT(( SinglePassRangeConcept<const SinglePassRange> ));
    return std::unique_copy(boost::begin(rng), boost::end(rng), out_it, pred);
}

    } // namespace range
    using range::unique_copy;
} // namespace boost

#endif // include guard


code:
subroutine wspr_fsk8_downsample(iwave,c)

! Input: i*2 data in iwave() at sample rate 12000 Hz
! Output: Complex data in c(), sampled at 12000/24=500 Hz

  include 'wspr_fsk8_params.f90'
  integer*2 iwave(NMAX)
  complex c(0:NMAXD-1)
  complex c1(0:NMAXD-1)
  complex cx(0:NMAX/2)
  real x(NMAX)
  equivalence (x,cx)

  df=12000.0/NMAX
  x=iwave
  call four2a(x,NMAX,1,-1,0)             !r2c FFT to freq domain
  i0=nint(1500.0/df)
  c1(0)=cx(i0)
  do i=1,NMAXD/2
     c1(i)=cx(i0+i)
     c1(NMAXD-i)=cx(i0-i)
  enddo
  c=c1/NMAXD
  call four2a(c,NMAXD,1,1,1)            !c2c FFT back to time domain

  return
end subroutine wspr_fsk8_downsample


code:
#if !defined(BOOST_PROTO_DONT_USE_PREPROCESSED_FILES)

    #include <boost/proto/detail/preprocessed/make_expr_funop.hpp>

#elif !defined(BOOST_PP_IS_ITERATING)

    #if defined(__WAVE__) && defined(BOOST_PROTO_CREATE_PREPROCESSED_FILES)
        #pragma wave option(preserve: 2, line: 0, output: "preprocessed/make_expr_funop.hpp")
    #endif

    ///////////////////////////////////////////////////////////////////////////////
    /// \file make_expr_funop.hpp
    /// Contains definition of make_expr\<\>::operator() member functions.
    //
    //  Copyright 2008 Eric Niebler. 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)

    #if defined(__WAVE__) && defined(BOOST_PROTO_CREATE_PREPROCESSED_FILES)
        #pragma wave option(preserve: 1)
    #endif

    #define BOOST_PP_ITERATION_PARAMS_1                                                     \
        (3, (2, BOOST_PROTO_MAX_ARITY, <boost/proto/detail/make_expr_funop.hpp>))
    #include BOOST_PP_ITERATE()

    #if defined(__WAVE__) && defined(BOOST_PROTO_CREATE_PREPROCESSED_FILES)
        #pragma wave option(output: null)
    #endif

#else // BOOST_PP_IS_ITERATING

    #define N BOOST_PP_ITERATION()

    template<typename This BOOST_PP_ENUM_TRAILING_PARAMS(N, typename A)>
    struct result<This(BOOST_PP_ENUM_PARAMS(N, A))>
    {
        typedef
            typename result_of::make_expr<
                Tag
              , Domain
                BOOST_PP_ENUM_TRAILING_PARAMS(N, A)
            >::type
        type;
    };

    /// \overload
    ///
    template<BOOST_PP_ENUM_PARAMS(N, typename A)>
    BOOST_FORCEINLINE
    typename result_of::make_expr<
        Tag
      , Domain
        BOOST_PP_ENUM_TRAILING_PARAMS(N, const A)
    >::type const
    operator ()(BOOST_PP_ENUM_BINARY_PARAMS(N, const A, &a)) const
    {
        return proto::detail::make_expr_<
            Tag
          , Domain
            BOOST_PP_ENUM_TRAILING_PARAMS(N, const A)
        >()(BOOST_PP_ENUM_PARAMS(N, a));
    }

    #undef N

#endif