rice 2.2.0 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/COPYING +2 -2
- data/Doxyfile +1 -1
- data/Makefile.in +15 -7
- data/README.md +115 -117
- data/aclocal.m4 +25 -28
- data/ax_cxx_compile_stdcxx.m4 +951 -0
- data/configure +486 -61
- data/configure.ac +3 -3
- data/extconf.rb +6 -2
- data/rice/Array.hpp +16 -16
- data/rice/Array.ipp +11 -11
- data/rice/Class_defn.hpp +1 -0
- data/rice/Constructor.hpp +27 -371
- data/rice/Director.hpp +3 -3
- data/rice/Exception.cpp +2 -7
- data/rice/Hash.hpp +8 -5
- data/rice/Makefile.am +0 -4
- data/rice/Makefile.in +6 -10
- data/rice/Object.cpp +1 -1
- data/rice/Object.ipp +15 -1
- data/rice/Object_defn.hpp +24 -1
- data/rice/String.cpp +2 -7
- data/rice/Struct.cpp +2 -2
- data/rice/Struct.hpp +1 -1
- data/rice/Struct.ipp +1 -1
- data/rice/config.hpp +2 -2
- data/rice/config.hpp.in +2 -2
- data/rice/detail/Arguments.hpp +1 -1
- data/rice/detail/Auto_Function_Wrapper.ipp +512 -1025
- data/rice/detail/Auto_Member_Function_Wrapper.ipp +272 -545
- data/rice/detail/ruby.hpp +0 -4
- data/rice/detail/ruby_version_code.hpp +1 -1
- data/rice/detail/wrap_function.hpp +32 -307
- data/rice/protect.hpp +3 -57
- data/rice/to_from_ruby.ipp +3 -3
- data/ruby/Makefile.in +4 -4
- data/ruby/lib/Makefile.in +4 -4
- data/ruby/lib/version.rb +1 -1
- data/sample/Makefile.am +10 -4
- data/sample/Makefile.in +14 -8
- data/sample/callbacks/extconf.rb +3 -0
- data/sample/callbacks/sample_callbacks.cpp +38 -0
- data/sample/callbacks/test.rb +28 -0
- data/test/Makefile.am +1 -0
- data/test/Makefile.in +15 -9
- data/test/embed_ruby.cpp +21 -0
- data/test/embed_ruby.hpp +4 -0
- data/test/ext/Makefile.in +4 -4
- data/test/test_Address_Registration_Guard.cpp +2 -1
- data/test/test_Array.cpp +2 -1
- data/test/test_Builtin_Object.cpp +2 -1
- data/test/test_Class.cpp +2 -1
- data/test/test_Data_Object.cpp +2 -1
- data/test/test_Data_Type.cpp +2 -1
- data/test/test_Director.cpp +2 -1
- data/test/test_Enum.cpp +2 -1
- data/test/test_Exception.cpp +2 -1
- data/test/test_Hash.cpp +2 -1
- data/test/test_Identifier.cpp +2 -1
- data/test/test_Memory_Management.cpp +2 -1
- data/test/test_Module.cpp +2 -1
- data/test/test_Object.cpp +13 -1
- data/test/test_String.cpp +2 -1
- data/test/test_Struct.cpp +2 -1
- data/test/test_Symbol.cpp +2 -1
- data/test/test_To_From_Ruby.cpp +2 -1
- data/test/test_global_functions.cpp +2 -1
- data/test/test_rice.rb +4 -0
- data/test/unittest.cpp +34 -8
- metadata +26 -11
- data/check_stdcxx_11.ac +0 -103
- data/rice/detail/object_call.hpp +0 -69
- data/rice/detail/object_call.ipp +0 -131
- data/rice/detail/traits.hpp +0 -43
- data/rice/detail/wrap_function.ipp +0 -514
data/configure
CHANGED
@@ -645,7 +645,7 @@ RUBY_CPPFLAGS
|
|
645
645
|
RUBY_VERSION_CODE
|
646
646
|
RUBY
|
647
647
|
RICE_USING_MINGW32
|
648
|
-
|
648
|
+
HAVE_CXX14
|
649
649
|
host_os
|
650
650
|
host_vendor
|
651
651
|
host_cpu
|
@@ -2127,12 +2127,7 @@ program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"`
|
|
2127
2127
|
am_aux_dir=`cd "$ac_aux_dir" && pwd`
|
2128
2128
|
|
2129
2129
|
if test x"${MISSING+set}" != xset; then
|
2130
|
-
|
2131
|
-
*\ * | *\ *)
|
2132
|
-
MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
|
2133
|
-
*)
|
2134
|
-
MISSING="\${SHELL} \"$am_aux_dir\"/missing" ;;
|
2135
|
-
esac
|
2130
|
+
MISSING="\${SHELL} '$am_aux_dir/missing'"
|
2136
2131
|
fi
|
2137
2132
|
# Use eval to expand $SHELL
|
2138
2133
|
if eval "$MISSING --is-lightweight"; then
|
@@ -3420,125 +3415,552 @@ else
|
|
3420
3415
|
RICE_USING_MINGW32="false"
|
3421
3416
|
fi
|
3422
3417
|
|
3423
|
-
#
|
3424
|
-
#
|
3425
|
-
#
|
3418
|
+
# ===========================================================================
|
3419
|
+
# https://www.gnu.org/software/autoconf-archive/ax_cxx_compile_stdcxx.html
|
3420
|
+
# ===========================================================================
|
3426
3421
|
#
|
3427
3422
|
# SYNOPSIS
|
3428
3423
|
#
|
3429
|
-
#
|
3424
|
+
# AX_CXX_COMPILE_STDCXX(VERSION, [ext|noext], [mandatory|optional])
|
3430
3425
|
#
|
3431
3426
|
# DESCRIPTION
|
3432
3427
|
#
|
3433
|
-
# Check for baseline language coverage in the compiler for the
|
3434
|
-
# standard
|
3428
|
+
# Check for baseline language coverage in the compiler for the specified
|
3429
|
+
# version of the C++ standard. If necessary, add switches to CXX and
|
3430
|
+
# CXXCPP to enable support. VERSION may be '11' (for the C++11 standard)
|
3431
|
+
# or '14' (for the C++14 standard).
|
3435
3432
|
#
|
3436
|
-
# The
|
3433
|
+
# The second argument, if specified, indicates whether you insist on an
|
3437
3434
|
# extended mode (e.g. -std=gnu++11) or a strict conformance mode (e.g.
|
3438
3435
|
# -std=c++11). If neither is specified, you get whatever works, with
|
3439
3436
|
# preference for an extended mode.
|
3440
3437
|
#
|
3441
|
-
# The
|
3442
|
-
# indicates that baseline
|
3443
|
-
# should error out if no mode with that
|
3444
|
-
# 'optional', then configuration proceeds
|
3445
|
-
#
|
3438
|
+
# The third argument, if specified 'mandatory' or if left unspecified,
|
3439
|
+
# indicates that baseline support for the specified C++ standard is
|
3440
|
+
# required and that the macro should error out if no mode with that
|
3441
|
+
# support is found. If specified 'optional', then configuration proceeds
|
3442
|
+
# regardless, after defining HAVE_CXX${VERSION} if and only if a
|
3443
|
+
# supporting mode is found.
|
3446
3444
|
#
|
3447
3445
|
# LICENSE
|
3448
3446
|
#
|
3449
3447
|
# Copyright (c) 2008 Benjamin Kosnik <bkoz@redhat.com>
|
3450
3448
|
# Copyright (c) 2012 Zack Weinberg <zackw@panix.com>
|
3451
3449
|
# Copyright (c) 2013 Roy Stogner <roystgnr@ices.utexas.edu>
|
3452
|
-
# Copyright (c) 2014 Alexey Sokolov <sokolov@google.com>
|
3450
|
+
# Copyright (c) 2014, 2015 Google Inc.; contributed by Alexey Sokolov <sokolov@google.com>
|
3451
|
+
# Copyright (c) 2015 Paul Norman <penorman@mac.com>
|
3452
|
+
# Copyright (c) 2015 Moritz Klammler <moritz@klammler.eu>
|
3453
|
+
# Copyright (c) 2016, 2018 Krzesimir Nowak <qdlacz@gmail.com>
|
3454
|
+
# Copyright (c) 2019 Enji Cooper <yaneurabeya@gmail.com>
|
3453
3455
|
#
|
3454
3456
|
# Copying and distribution of this file, with or without modification, are
|
3455
3457
|
# permitted in any medium without royalty provided the copyright notice
|
3456
|
-
# and this notice are preserved.
|
3458
|
+
# and this notice are preserved. This file is offered as-is, without any
|
3457
3459
|
# warranty.
|
3458
3460
|
|
3459
|
-
#serial
|
3461
|
+
#serial 11
|
3462
|
+
|
3463
|
+
|
3464
|
+
|
3465
|
+
|
3466
|
+
|
3467
|
+
|
3468
|
+
|
3469
|
+
|
3470
|
+
|
3471
|
+
|
3460
3472
|
|
3461
3473
|
|
3462
3474
|
|
3463
3475
|
|
3464
3476
|
|
3465
3477
|
|
3466
|
-
|
3478
|
+
|
3479
|
+
|
3480
|
+
|
3481
|
+
|
3482
|
+
|
3483
|
+
|
3484
|
+
|
3485
|
+
|
3486
|
+
|
3487
|
+
|
3488
|
+
ax_cxx_compile_alternatives="14 1y" ax_cxx_compile_cxx14_required=true
|
3467
3489
|
ac_ext=cpp
|
3468
3490
|
ac_cpp='$CXXCPP $CPPFLAGS'
|
3469
3491
|
ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
|
3470
3492
|
ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
|
3471
3493
|
ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
|
3472
3494
|
ac_success=no
|
3473
|
-
|
3474
|
-
|
3475
|
-
|
3495
|
+
|
3496
|
+
|
3497
|
+
|
3498
|
+
if test x$ac_success = xno; then
|
3499
|
+
for alternative in ${ax_cxx_compile_alternatives}; do
|
3500
|
+
for switch in -std=c++${alternative} +std=c++${alternative} "-h std=c++${alternative}"; do
|
3501
|
+
cachevar=`$as_echo "ax_cv_cxx_compile_cxx14_$switch" | $as_tr_sh`
|
3502
|
+
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CXX supports C++14 features with $switch" >&5
|
3503
|
+
$as_echo_n "checking whether $CXX supports C++14 features with $switch... " >&6; }
|
3504
|
+
if eval \${$cachevar+:} false; then :
|
3476
3505
|
$as_echo_n "(cached) " >&6
|
3477
3506
|
else
|
3478
|
-
|
3507
|
+
ac_save_CXX="$CXX"
|
3508
|
+
CXX="$CXX $switch"
|
3509
|
+
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
|
3479
3510
|
/* end confdefs.h. */
|
3480
3511
|
|
3481
|
-
|
3512
|
+
|
3513
|
+
// If the compiler admits that it is not ready for C++11, why torture it?
|
3514
|
+
// Hopefully, this will speed up the test.
|
3515
|
+
|
3516
|
+
#ifndef __cplusplus
|
3517
|
+
|
3518
|
+
#error "This is not a C++ compiler"
|
3519
|
+
|
3520
|
+
#elif __cplusplus < 201103L
|
3521
|
+
|
3522
|
+
#error "This is not a C++11 compiler"
|
3523
|
+
|
3524
|
+
#else
|
3525
|
+
|
3526
|
+
namespace cxx11
|
3527
|
+
{
|
3528
|
+
|
3529
|
+
namespace test_static_assert
|
3530
|
+
{
|
3531
|
+
|
3532
|
+
template <typename T>
|
3482
3533
|
struct check
|
3483
3534
|
{
|
3484
3535
|
static_assert(sizeof(int) <= sizeof(T), "not big enough");
|
3485
3536
|
};
|
3486
3537
|
|
3487
|
-
|
3488
|
-
|
3538
|
+
}
|
3539
|
+
|
3540
|
+
namespace test_final_override
|
3541
|
+
{
|
3542
|
+
|
3543
|
+
struct Base
|
3544
|
+
{
|
3545
|
+
virtual ~Base() {}
|
3546
|
+
virtual void f() {}
|
3547
|
+
};
|
3548
|
+
|
3549
|
+
struct Derived : public Base
|
3550
|
+
{
|
3551
|
+
virtual ~Derived() override {}
|
3552
|
+
virtual void f() override {}
|
3553
|
+
};
|
3554
|
+
|
3555
|
+
}
|
3556
|
+
|
3557
|
+
namespace test_double_right_angle_brackets
|
3558
|
+
{
|
3559
|
+
|
3560
|
+
template < typename T >
|
3561
|
+
struct check {};
|
3562
|
+
|
3563
|
+
typedef check<void> single_type;
|
3564
|
+
typedef check<check<void>> double_type;
|
3565
|
+
typedef check<check<check<void>>> triple_type;
|
3566
|
+
typedef check<check<check<check<void>>>> quadruple_type;
|
3567
|
+
|
3568
|
+
}
|
3569
|
+
|
3570
|
+
namespace test_decltype
|
3571
|
+
{
|
3572
|
+
|
3573
|
+
int
|
3574
|
+
f()
|
3575
|
+
{
|
3576
|
+
int a = 1;
|
3577
|
+
decltype(a) b = 2;
|
3578
|
+
return a + b;
|
3579
|
+
}
|
3580
|
+
|
3581
|
+
}
|
3582
|
+
|
3583
|
+
namespace test_type_deduction
|
3584
|
+
{
|
3585
|
+
|
3586
|
+
template < typename T1, typename T2 >
|
3587
|
+
struct is_same
|
3588
|
+
{
|
3589
|
+
static const bool value = false;
|
3590
|
+
};
|
3591
|
+
|
3592
|
+
template < typename T >
|
3593
|
+
struct is_same<T, T>
|
3594
|
+
{
|
3595
|
+
static const bool value = true;
|
3596
|
+
};
|
3597
|
+
|
3598
|
+
template < typename T1, typename T2 >
|
3599
|
+
auto
|
3600
|
+
add(T1 a1, T2 a2) -> decltype(a1 + a2)
|
3601
|
+
{
|
3602
|
+
return a1 + a2;
|
3603
|
+
}
|
3604
|
+
|
3605
|
+
int
|
3606
|
+
test(const int c, volatile int v)
|
3607
|
+
{
|
3608
|
+
static_assert(is_same<int, decltype(0)>::value == true, "");
|
3609
|
+
static_assert(is_same<int, decltype(c)>::value == false, "");
|
3610
|
+
static_assert(is_same<int, decltype(v)>::value == false, "");
|
3611
|
+
auto ac = c;
|
3612
|
+
auto av = v;
|
3613
|
+
auto sumi = ac + av + 'x';
|
3614
|
+
auto sumf = ac + av + 1.0;
|
3615
|
+
static_assert(is_same<int, decltype(ac)>::value == true, "");
|
3616
|
+
static_assert(is_same<int, decltype(av)>::value == true, "");
|
3617
|
+
static_assert(is_same<int, decltype(sumi)>::value == true, "");
|
3618
|
+
static_assert(is_same<int, decltype(sumf)>::value == false, "");
|
3619
|
+
static_assert(is_same<int, decltype(add(c, v))>::value == true, "");
|
3620
|
+
return (sumf > 0.0) ? sumi : add(c, v);
|
3621
|
+
}
|
3622
|
+
|
3623
|
+
}
|
3624
|
+
|
3625
|
+
namespace test_noexcept
|
3626
|
+
{
|
3627
|
+
|
3628
|
+
int f() { return 0; }
|
3629
|
+
int g() noexcept { return 0; }
|
3630
|
+
|
3631
|
+
static_assert(noexcept(f()) == false, "");
|
3632
|
+
static_assert(noexcept(g()) == true, "");
|
3633
|
+
|
3634
|
+
}
|
3635
|
+
|
3636
|
+
namespace test_constexpr
|
3637
|
+
{
|
3638
|
+
|
3639
|
+
template < typename CharT >
|
3640
|
+
unsigned long constexpr
|
3641
|
+
strlen_c_r(const CharT *const s, const unsigned long acc) noexcept
|
3642
|
+
{
|
3643
|
+
return *s ? strlen_c_r(s + 1, acc + 1) : acc;
|
3644
|
+
}
|
3645
|
+
|
3646
|
+
template < typename CharT >
|
3647
|
+
unsigned long constexpr
|
3648
|
+
strlen_c(const CharT *const s) noexcept
|
3649
|
+
{
|
3650
|
+
return strlen_c_r(s, 0UL);
|
3651
|
+
}
|
3652
|
+
|
3653
|
+
static_assert(strlen_c("") == 0UL, "");
|
3654
|
+
static_assert(strlen_c("1") == 1UL, "");
|
3655
|
+
static_assert(strlen_c("example") == 7UL, "");
|
3656
|
+
static_assert(strlen_c("another\0example") == 7UL, "");
|
3657
|
+
|
3658
|
+
}
|
3659
|
+
|
3660
|
+
namespace test_rvalue_references
|
3661
|
+
{
|
3662
|
+
|
3663
|
+
template < int N >
|
3664
|
+
struct answer
|
3665
|
+
{
|
3666
|
+
static constexpr int value = N;
|
3667
|
+
};
|
3668
|
+
|
3669
|
+
answer<1> f(int&) { return answer<1>(); }
|
3670
|
+
answer<2> f(const int&) { return answer<2>(); }
|
3671
|
+
answer<3> f(int&&) { return answer<3>(); }
|
3672
|
+
|
3673
|
+
void
|
3674
|
+
test()
|
3675
|
+
{
|
3676
|
+
int i = 0;
|
3677
|
+
const int c = 0;
|
3678
|
+
static_assert(decltype(f(i))::value == 1, "");
|
3679
|
+
static_assert(decltype(f(c))::value == 2, "");
|
3680
|
+
static_assert(decltype(f(0))::value == 3, "");
|
3681
|
+
}
|
3682
|
+
|
3683
|
+
}
|
3684
|
+
|
3685
|
+
namespace test_uniform_initialization
|
3686
|
+
{
|
3687
|
+
|
3688
|
+
struct test
|
3689
|
+
{
|
3690
|
+
static const int zero {};
|
3691
|
+
static const int one {1};
|
3692
|
+
};
|
3693
|
+
|
3694
|
+
static_assert(test::zero == 0, "");
|
3695
|
+
static_assert(test::one == 1, "");
|
3696
|
+
|
3697
|
+
}
|
3698
|
+
|
3699
|
+
namespace test_lambdas
|
3700
|
+
{
|
3701
|
+
|
3702
|
+
void
|
3703
|
+
test1()
|
3704
|
+
{
|
3705
|
+
auto lambda1 = [](){};
|
3706
|
+
auto lambda2 = lambda1;
|
3707
|
+
lambda1();
|
3708
|
+
lambda2();
|
3709
|
+
}
|
3710
|
+
|
3711
|
+
int
|
3712
|
+
test2()
|
3713
|
+
{
|
3714
|
+
auto a = [](int i, int j){ return i + j; }(1, 2);
|
3715
|
+
auto b = []() -> int { return '0'; }();
|
3716
|
+
auto c = [=](){ return a + b; }();
|
3717
|
+
auto d = [&](){ return c; }();
|
3718
|
+
auto e = [a, &b](int x) mutable {
|
3719
|
+
const auto identity = [](int y){ return y; };
|
3720
|
+
for (auto i = 0; i < a; ++i)
|
3721
|
+
a += b--;
|
3722
|
+
return x + identity(a + b);
|
3723
|
+
}(0);
|
3724
|
+
return a + b + c + d + e;
|
3725
|
+
}
|
3726
|
+
|
3727
|
+
int
|
3728
|
+
test3()
|
3729
|
+
{
|
3730
|
+
const auto nullary = [](){ return 0; };
|
3731
|
+
const auto unary = [](int x){ return x; };
|
3732
|
+
using nullary_t = decltype(nullary);
|
3733
|
+
using unary_t = decltype(unary);
|
3734
|
+
const auto higher1st = [](nullary_t f){ return f(); };
|
3735
|
+
const auto higher2nd = [unary](nullary_t f1){
|
3736
|
+
return [unary, f1](unary_t f2){ return f2(unary(f1())); };
|
3737
|
+
};
|
3738
|
+
return higher1st(nullary) + higher2nd(nullary)(unary);
|
3739
|
+
}
|
3740
|
+
|
3741
|
+
}
|
3742
|
+
|
3743
|
+
namespace test_variadic_templates
|
3744
|
+
{
|
3745
|
+
|
3746
|
+
template <int...>
|
3747
|
+
struct sum;
|
3748
|
+
|
3749
|
+
template <int N0, int... N1toN>
|
3750
|
+
struct sum<N0, N1toN...>
|
3751
|
+
{
|
3752
|
+
static constexpr auto value = N0 + sum<N1toN...>::value;
|
3489
3753
|
};
|
3490
|
-
|
3491
|
-
|
3754
|
+
|
3755
|
+
template <>
|
3756
|
+
struct sum<>
|
3757
|
+
{
|
3758
|
+
static constexpr auto value = 0;
|
3492
3759
|
};
|
3493
3760
|
|
3494
|
-
|
3761
|
+
static_assert(sum<>::value == 0, "");
|
3762
|
+
static_assert(sum<1>::value == 1, "");
|
3763
|
+
static_assert(sum<23>::value == 23, "");
|
3764
|
+
static_assert(sum<1, 2>::value == 3, "");
|
3765
|
+
static_assert(sum<5, 5, 11>::value == 21, "");
|
3766
|
+
static_assert(sum<2, 3, 5, 7, 11, 13>::value == 41, "");
|
3767
|
+
|
3768
|
+
}
|
3769
|
+
|
3770
|
+
// http://stackoverflow.com/questions/13728184/template-aliases-and-sfinae
|
3771
|
+
// Clang 3.1 fails with headers of libstd++ 4.8.3 when using std::function
|
3772
|
+
// because of this.
|
3773
|
+
namespace test_template_alias_sfinae
|
3774
|
+
{
|
3775
|
+
|
3776
|
+
struct foo {};
|
3777
|
+
|
3778
|
+
template<typename T>
|
3779
|
+
using member = typename T::member_type;
|
3780
|
+
|
3781
|
+
template<typename T>
|
3782
|
+
void func(...) {}
|
3783
|
+
|
3784
|
+
template<typename T>
|
3785
|
+
void func(member<T>*) {}
|
3786
|
+
|
3787
|
+
void test();
|
3788
|
+
|
3789
|
+
void test() { func<foo>(0); }
|
3790
|
+
|
3791
|
+
}
|
3792
|
+
|
3793
|
+
} // namespace cxx11
|
3794
|
+
|
3795
|
+
#endif // __cplusplus >= 201103L
|
3796
|
+
|
3797
|
+
|
3798
|
+
|
3495
3799
|
|
3496
|
-
|
3497
|
-
|
3800
|
+
// If the compiler admits that it is not ready for C++14, why torture it?
|
3801
|
+
// Hopefully, this will speed up the test.
|
3802
|
+
|
3803
|
+
#ifndef __cplusplus
|
3804
|
+
|
3805
|
+
#error "This is not a C++ compiler"
|
3806
|
+
|
3807
|
+
#elif __cplusplus < 201402L
|
3808
|
+
|
3809
|
+
#error "This is not a C++14 compiler"
|
3810
|
+
|
3811
|
+
#else
|
3812
|
+
|
3813
|
+
namespace cxx14
|
3814
|
+
{
|
3815
|
+
|
3816
|
+
namespace test_polymorphic_lambdas
|
3817
|
+
{
|
3818
|
+
|
3819
|
+
int
|
3820
|
+
test()
|
3821
|
+
{
|
3822
|
+
const auto lambda = [](auto&&... args){
|
3823
|
+
const auto istiny = [](auto x){
|
3824
|
+
return (sizeof(x) == 1UL) ? 1 : 0;
|
3825
|
+
};
|
3826
|
+
const int aretiny[] = { istiny(args)... };
|
3827
|
+
return aretiny[0];
|
3828
|
+
};
|
3829
|
+
return lambda(1, 1L, 1.0f, '1');
|
3830
|
+
}
|
3831
|
+
|
3832
|
+
}
|
3833
|
+
|
3834
|
+
namespace test_binary_literals
|
3835
|
+
{
|
3836
|
+
|
3837
|
+
constexpr auto ivii = 0b0000000000101010;
|
3838
|
+
static_assert(ivii == 42, "wrong value");
|
3839
|
+
|
3840
|
+
}
|
3841
|
+
|
3842
|
+
namespace test_generalized_constexpr
|
3843
|
+
{
|
3844
|
+
|
3845
|
+
template < typename CharT >
|
3846
|
+
constexpr unsigned long
|
3847
|
+
strlen_c(const CharT *const s) noexcept
|
3848
|
+
{
|
3849
|
+
auto length = 0UL;
|
3850
|
+
for (auto p = s; *p; ++p)
|
3851
|
+
++length;
|
3852
|
+
return length;
|
3853
|
+
}
|
3854
|
+
|
3855
|
+
static_assert(strlen_c("") == 0UL, "");
|
3856
|
+
static_assert(strlen_c("x") == 1UL, "");
|
3857
|
+
static_assert(strlen_c("test") == 4UL, "");
|
3858
|
+
static_assert(strlen_c("another\0test") == 7UL, "");
|
3859
|
+
|
3860
|
+
}
|
3861
|
+
|
3862
|
+
namespace test_lambda_init_capture
|
3863
|
+
{
|
3864
|
+
|
3865
|
+
int
|
3866
|
+
test()
|
3867
|
+
{
|
3868
|
+
auto x = 0;
|
3869
|
+
const auto lambda1 = [a = x](int b){ return a + b; };
|
3870
|
+
const auto lambda2 = [a = lambda1(x)](){ return a; };
|
3871
|
+
return lambda2();
|
3872
|
+
}
|
3873
|
+
|
3874
|
+
}
|
3875
|
+
|
3876
|
+
namespace test_digit_separators
|
3877
|
+
{
|
3878
|
+
|
3879
|
+
constexpr auto ten_million = 100'000'000;
|
3880
|
+
static_assert(ten_million == 100000000, "");
|
3881
|
+
|
3882
|
+
}
|
3883
|
+
|
3884
|
+
namespace test_return_type_deduction
|
3885
|
+
{
|
3886
|
+
|
3887
|
+
auto f(int& x) { return x; }
|
3888
|
+
decltype(auto) g(int& x) { return x; }
|
3889
|
+
|
3890
|
+
template < typename T1, typename T2 >
|
3891
|
+
struct is_same
|
3892
|
+
{
|
3893
|
+
static constexpr auto value = false;
|
3894
|
+
};
|
3895
|
+
|
3896
|
+
template < typename T >
|
3897
|
+
struct is_same<T, T>
|
3898
|
+
{
|
3899
|
+
static constexpr auto value = true;
|
3900
|
+
};
|
3901
|
+
|
3902
|
+
int
|
3903
|
+
test()
|
3904
|
+
{
|
3905
|
+
auto x = 0;
|
3906
|
+
static_assert(is_same<int, decltype(f(x))>::value, "");
|
3907
|
+
static_assert(is_same<int&, decltype(g(x))>::value, "");
|
3908
|
+
return x;
|
3909
|
+
}
|
3910
|
+
|
3911
|
+
}
|
3912
|
+
|
3913
|
+
} // namespace cxx14
|
3914
|
+
|
3915
|
+
#endif // __cplusplus >= 201402L
|
3498
3916
|
|
3499
|
-
typedef check<int> check_type;
|
3500
|
-
check_type c;
|
3501
|
-
check_type&& cr = static_cast<check_type&&>(c);
|
3502
3917
|
|
3503
|
-
auto d = a;
|
3504
|
-
auto l = [](){};
|
3505
3918
|
|
3506
3919
|
_ACEOF
|
3507
3920
|
if ac_fn_cxx_try_compile "$LINENO"; then :
|
3508
|
-
|
3921
|
+
eval $cachevar=yes
|
3509
3922
|
else
|
3510
|
-
|
3923
|
+
eval $cachevar=no
|
3511
3924
|
fi
|
3512
3925
|
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
|
3926
|
+
CXX="$ac_save_CXX"
|
3513
3927
|
fi
|
3514
|
-
|
3515
|
-
$as_echo "$
|
3516
|
-
|
3517
|
-
|
3928
|
+
eval ac_res=\$$cachevar
|
3929
|
+
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
|
3930
|
+
$as_echo "$ac_res" >&6; }
|
3931
|
+
if eval test x\$$cachevar = xyes; then
|
3932
|
+
CXX="$CXX $switch"
|
3933
|
+
if test -n "$CXXCPP" ; then
|
3934
|
+
CXXCPP="$CXXCPP $switch"
|
3935
|
+
fi
|
3936
|
+
ac_success=yes
|
3937
|
+
break
|
3938
|
+
fi
|
3939
|
+
done
|
3940
|
+
if test x$ac_success = xyes; then
|
3941
|
+
break
|
3942
|
+
fi
|
3943
|
+
done
|
3518
3944
|
fi
|
3519
|
-
|
3520
3945
|
ac_ext=cpp
|
3521
3946
|
ac_cpp='$CXXCPP $CPPFLAGS'
|
3522
3947
|
ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
|
3523
3948
|
ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
|
3524
3949
|
ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
|
3525
3950
|
|
3526
|
-
if test x$
|
3951
|
+
if test x$ax_cxx_compile_cxx14_required = xtrue; then
|
3527
3952
|
if test x$ac_success = xno; then
|
3528
|
-
as_fn_error $? "*** A compiler with support for C++
|
3953
|
+
as_fn_error $? "*** A compiler with support for C++14 language features is required." "$LINENO" 5
|
3529
3954
|
fi
|
3955
|
+
fi
|
3956
|
+
if test x$ac_success = xno; then
|
3957
|
+
HAVE_CXX14=0
|
3958
|
+
{ $as_echo "$as_me:${as_lineno-$LINENO}: No compiler with C++14 support was found" >&5
|
3959
|
+
$as_echo "$as_me: No compiler with C++14 support was found" >&6;}
|
3530
3960
|
else
|
3531
|
-
|
3532
|
-
HAVE_CXX11=0
|
3533
|
-
{ $as_echo "$as_me:${as_lineno-$LINENO}: No compiler with C++11 support was found" >&5
|
3534
|
-
$as_echo "$as_me: No compiler with C++11 support was found" >&6;}
|
3535
|
-
else
|
3536
|
-
HAVE_CXX11=1
|
3537
|
-
|
3538
|
-
$as_echo "#define HAVE_CXX11 1" >>confdefs.h
|
3539
|
-
|
3540
|
-
fi
|
3961
|
+
HAVE_CXX14=1
|
3541
3962
|
|
3963
|
+
$as_echo "#define HAVE_CXX14 1" >>confdefs.h
|
3542
3964
|
|
3543
3965
|
fi
|
3544
3966
|
|
@@ -3553,6 +3975,7 @@ $as_echo "#define HAVE_CXX11 1" >>confdefs.h
|
|
3553
3975
|
|
3554
3976
|
|
3555
3977
|
|
3978
|
+
|
3556
3979
|
# Check whether --with-ruby was given.
|
3557
3980
|
if test "${with_ruby+set}" = set; then :
|
3558
3981
|
withval=$with_ruby; RUBY=$withval
|
@@ -5804,7 +6227,7 @@ esac
|
|
5804
6227
|
#echo DX_ENV=$DX_ENV
|
5805
6228
|
|
5806
6229
|
|
5807
|
-
RICE_SAMPLES="enum map inheritance"
|
6230
|
+
RICE_SAMPLES="enum map inheritance callbacks"
|
5808
6231
|
|
5809
6232
|
|
5810
6233
|
RICE_ROOT=`pwd`
|
@@ -7313,7 +7736,9 @@ $as_echo X/"$am_mf" |
|
|
7313
7736
|
{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
|
7314
7737
|
$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
|
7315
7738
|
as_fn_error $? "Something went wrong bootstrapping makefile fragments
|
7316
|
-
for automatic dependency tracking.
|
7739
|
+
for automatic dependency tracking. If GNU make was not used, consider
|
7740
|
+
re-running the configure script with MAKE=\"gmake\" (or whatever is
|
7741
|
+
necessary). You can also try re-running configure with the
|
7317
7742
|
'--disable-dependency-tracking' option to at least be able to build
|
7318
7743
|
the package (albeit without support for automatic dependency tracking).
|
7319
7744
|
See \`config.log' for more details" "$LINENO" 5; }
|