/usr/include/soci/boost-optional.h is in libsoci-dev 3.2.3-2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 | //
// Copyright (C) 2004-2008 Maciej Sobczak, Stephen Hutton
// 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 SOCI_BOOST_OPTIONAL_H_INCLUDED
#define SOCI_BOOST_OPTIONAL_H_INCLUDED
#include "type-conversion-traits.h"
// boost
#include <boost/optional.hpp>
namespace soci
{
// simple fall-back for boost::optional
template <typename T>
struct type_conversion<boost::optional<T> >
{
typedef typename type_conversion<T>::base_type base_type;
static void from_base(base_type const & in, indicator ind,
boost::optional<T> & out)
{
if (ind == i_null)
{
out.reset();
}
else
{
T tmp;
type_conversion<T>::from_base(in, ind, tmp);
out = tmp;
}
}
static void to_base(boost::optional<T> const & in,
base_type & out, indicator & ind)
{
if (in.is_initialized())
{
type_conversion<T>::to_base(in.get(), out, ind);
}
else
{
ind = i_null;
}
}
};
} // namespace soci
#endif // SOCI_BOOST_OPTIONAL_H_INCLUDED
|