Compare commits

...

6 Commits

Author SHA1 Message Date
500e4fa0a2 Merge pull request #21 from igaztanaga/patch-1
Small fix for those using -Wsign-conversion
2021-12-30 23:20:18 +08:00
ded3c1d5c1 Merge branch 'boostorg:develop' into patch-1 2021-12-30 15:02:46 +01:00
aa16ae3ff0 Merge pull request #20 from sdarwin/feature/gha_fix_1
Update GitHub Actions CI file
2021-11-16 19:25:04 +02:00
7c01e916a3 More fixes for -Wsign-conversion 2021-10-11 13:26:45 +02:00
819b3dd67b Small fix for those using -Wsign-conversion 2021-10-11 13:18:23 +02:00
0b8f586814 Update GitHub Actions CI file 2021-07-30 16:10:39 +00:00
2 changed files with 45 additions and 28 deletions

View File

@ -21,7 +21,8 @@ jobs:
buildtype: "boost"
packages: ""
packages_to_remove: ""
os: "ubuntu-16.04"
os: "ubuntu-20.04"
container: "ubuntu:16.04"
cxx: "g++"
sources: ""
llvm_os: ""
@ -33,7 +34,8 @@ jobs:
buildtype: "boost"
packages: "g++-5"
packages_to_remove: ""
os: "ubuntu-16.04"
os: "ubuntu-20.04"
container: "ubuntu:16.04"
cxx: "g++-5"
sources: ""
llvm_os: ""
@ -45,7 +47,8 @@ jobs:
buildtype: "boost"
packages: "g++-6"
packages_to_remove: ""
os: "ubuntu-16.04"
os: "ubuntu-20.04"
container: "ubuntu:16.04"
cxx: "g++-6"
sources: ""
llvm_os: ""
@ -57,7 +60,8 @@ jobs:
buildtype: "boost"
packages: "g++-7"
packages_to_remove: ""
os: "ubuntu-16.04"
os: "ubuntu-20.04"
container: "ubuntu:16.04"
cxx: "g++-7"
sources: ""
llvm_os: ""
@ -69,7 +73,7 @@ jobs:
buildtype: "boost"
packages: ""
packages_to_remove: ""
os: "ubuntu-16.04"
os: "ubuntu-18.04"
cxx: "clang++"
sources: ""
llvm_os: ""
@ -81,7 +85,8 @@ jobs:
buildtype: "boost"
packages: "clang-4.0"
packages_to_remove: ""
os: "ubuntu-16.04"
os: "ubuntu-20.04"
container: "ubuntu:16.04"
cxx: "clang++-4.0"
sources: ""
llvm_os: "xenial"
@ -93,7 +98,8 @@ jobs:
buildtype: "boost"
packages: "clang-5.0"
packages_to_remove: ""
os: "ubuntu-16.04"
os: "ubuntu-20.04"
container: "ubuntu:16.04"
cxx: "clang++-5.0"
sources: ""
llvm_os: "xenial"
@ -109,6 +115,16 @@ jobs:
- name: Check if running in container
if: matrix.container != ''
run: echo "GHA_CONTAINER=${{ matrix.container }}" >> $GITHUB_ENV
- name: If running in container, upgrade packages
if: matrix.container != ''
run: |
apt-get -o Acquire::Retries=3 update && DEBIAN_FRONTEND=noninteractive apt-get -y install tzdata && apt-get -o Acquire::Retries=3 install -y sudo software-properties-common wget curl apt-transport-https make apt-file sudo unzip libssl-dev build-essential autotools-dev autoconf automake g++ libc++-helpers python ruby cpio gcc-multilib g++-multilib pkgconf python3 ccache libpython-dev
sudo apt-add-repository ppa:git-core/ppa
sudo apt-get -o Acquire::Retries=3 update && apt-get -o Acquire::Retries=3 -y install git
python_version=$(python3 -c 'import sys; print("{0.major}.{0.minor}".format(sys.version_info))')
sudo wget https://bootstrap.pypa.io/pip/$python_version/get-pip.py
sudo python3 get-pip.py
sudo /usr/local/bin/pip install cmake
- uses: actions/checkout@v2

View File

@ -34,6 +34,7 @@
#include <utility> // needed for the assignment from pair to tuple
#include <cstddef> // for std::size_t
#include <boost/type_traits/cv_traits.hpp>
#include <boost/type_traits/function_traits.hpp>
@ -93,7 +94,7 @@ namespace detail {
template<class T>
class generate_error;
template<int N>
template<std::size_t N>
struct drop_front {
template<class Tuple>
struct apply {
@ -127,14 +128,14 @@ struct drop_front<0> {
#ifndef BOOST_NO_CV_SPECIALIZATIONS
template<int N, class T>
template<std::size_t N, class T>
struct element
{
typedef BOOST_DEDUCED_TYPENAME detail::drop_front<N>::BOOST_NESTED_TEMPLATE
apply<T>::type::head_type type;
};
template<int N, class T>
template<std::size_t N, class T>
struct element<N, const T>
{
private:
@ -151,14 +152,14 @@ public:
namespace detail {
template<int N, class T, bool IsConst>
template<std::size_t N, class T, bool IsConst>
struct element_impl
{
typedef BOOST_DEDUCED_TYPENAME detail::drop_front<N>::BOOST_NESTED_TEMPLATE
apply<T>::type::head_type type;
};
template<int N, class T>
template<std::size_t N, class T>
struct element_impl<N, T, true /* IsConst */>
{
typedef BOOST_DEDUCED_TYPENAME detail::drop_front<N>::BOOST_NESTED_TEMPLATE
@ -169,7 +170,7 @@ struct element_impl<N, T, true /* IsConst */>
} // end of namespace detail
template<int N, class T>
template<std::size_t N, class T>
struct element:
public detail::element_impl<N, T, ::boost::is_const<T>::value>
{
@ -210,7 +211,7 @@ template <class T> struct access_traits<T&> {
// get function for non-const cons-lists, returns a reference to the element
template<int N, class HT, class TT>
template<std::size_t N, class HT, class TT>
inline typename access_traits<
typename element<N, cons<HT, TT> >::type
>::non_const_type
@ -224,7 +225,7 @@ get(cons<HT, TT>& c) {
// get function for const cons-lists, returns a const reference to
// the element. If the element is a reference, returns the reference
// as such (that is, can return a non-const reference)
template<int N, class HT, class TT>
template<std::size_t N, class HT, class TT>
inline typename access_traits<
typename element<N, cons<HT, TT> >::type
>::const_type
@ -333,7 +334,7 @@ struct cons {
}
// get member functions (non-const and const)
template <int N>
template <std::size_t N>
typename access_traits<
typename element<N, cons<HT, TT> >::type
>::non_const_type
@ -341,7 +342,7 @@ struct cons {
return boost::tuples::get<N>(*this); // delegate to non-member get
}
template <int N>
template <std::size_t N>
typename access_traits<
typename element<N, cons<HT, TT> >::type
>::const_type
@ -403,7 +404,7 @@ struct cons<HT, null_type> {
// is illformed if HT is a reference
cons& operator=(const cons& u) { head = u.head; return *this; }
template <int N>
template <std::size_t N>
typename access_traits<
typename element<N, self_type>::type
>::non_const_type
@ -411,7 +412,7 @@ struct cons<HT, null_type> {
return boost::tuples::get<N>(*this);
}
template <int N>
template <std::size_t N>
typename access_traits<
typename element<N, self_type>::type
>::const_type
@ -424,27 +425,27 @@ struct cons<HT, null_type> {
// templates for finding out the length of the tuple -------------------
template<class T>
struct length: boost::integral_constant<int, 1 + length<typename T::tail_type>::value>
struct length: boost::integral_constant<std::size_t, 1 + length<typename T::tail_type>::value>
{
};
template<>
struct length<tuple<> >: boost::integral_constant<int, 0>
struct length<tuple<> >: boost::integral_constant<std::size_t, 0>
{
};
template<>
struct length<tuple<> const>: boost::integral_constant<int, 0>
struct length<tuple<> const>: boost::integral_constant<std::size_t, 0>
{
};
template<>
struct length<null_type>: boost::integral_constant<int, 0>
struct length<null_type>: boost::integral_constant<std::size_t, 0>
{
};
template<>
struct length<null_type const>: boost::integral_constant<int, 0>
struct length<null_type const>: boost::integral_constant<std::size_t, 0>
{
};
@ -676,20 +677,20 @@ struct make_tuple_traits<T&> {
// All arrays are converted to const. This is because make_tuple takes its
// parameters as const T& and thus the knowledge of the potential
// non-constness of actual argument is lost.
template<class T, int n> struct make_tuple_traits <T[n]> {
template<class T, std::size_t n> struct make_tuple_traits <T[n]> {
typedef const T (&type)[n];
};
template<class T, int n>
template<class T, std::size_t n>
struct make_tuple_traits<const T[n]> {
typedef const T (&type)[n];
};
template<class T, int n> struct make_tuple_traits<volatile T[n]> {
template<class T, std::size_t n> struct make_tuple_traits<volatile T[n]> {
typedef const volatile T (&type)[n];
};
template<class T, int n>
template<class T, std::size_t n>
struct make_tuple_traits<const volatile T[n]> {
typedef const volatile T (&type)[n];
};