Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » Eclipse CDT C++ throwing Syntax Error(I am a beginner in C++ programming, we were told to enable C++17 support in any IDE you're using and I did in Eclipse CDT, I can successfully build and run the project but there's still a yellow under)
Eclipse CDT C++ throwing Syntax Error [message #1831851] Tue, 01 September 2020 04:15 Go to next message
Rajdeep Thakare is currently offline Rajdeep ThakareFriend
Messages: 2
Registered: September 2020
Junior Member
Code:
#include <array>
#include <iostream>
#include <string_view>
#include <tuple>
#include <type_traits>

namespace a::b::c
{
    inline constexpr std::string_view str{ "hello" };
}

template <class... T>
std::tuple<std::size_t, std::common_type_t<T...>> sum(T... args)
{
    return { sizeof...(T), (args + ...) };
}

int main()
{
    auto [iNumbers, iSum]{ sum(1, 2, 3) };
    std::cout << a::b::c::str << ' ' << iNumbers << ' ' << iSum << '\n';

    std::array arr{ 1, 2, 3 };

    std::cout << std::size(arr) << '\n';

    return 0;
}


I am getting error in this statement:

{
    return { sizeof...(T), (args + ...) };
}
Re: Eclipse CDT C++ throwing Syntax Error [message #1831894 is a reply to message #1831851] Wed, 02 September 2020 03:26 Go to previous message
David VavraFriend
Messages: 1426
Registered: October 2012
Senior Member
It doesn't work at least in 2019-09
I haven't tried any newer version.
You could submit a bug report.

[Updated on: Wed, 02 September 2020 04:00]

Report message to a moderator

Previous Topic:Pretty-printer is not working for inspecting the value of containers
Next Topic:[[maybe_unused]] C++17
Goto Forum:
  


Current Time: Mon Oct 14 02:32:34 GMT 2024

Powered by FUDForum. Page generated in 0.03591 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top