Coder Social home page Coder Social logo

Problems migrating from STL to ETL about etl HOT 9 CLOSED

etlcpp avatar etlcpp commented on May 21, 2024
Problems migrating from STL to ETL

from etl.

Comments (9)

nlohmann avatar nlohmann commented on May 21, 2024

Hi there! Any reaction on this?

from etl.

jwellbelove avatar jwellbelove commented on May 21, 2024

Sorry to be so late in replying, but I've been on holiday in India for the last two weeks and I had very limited internet access!

It looks like the GCC version you are using doesn't support static_assert. At the moment the header assumes that GCC supports this. I will have to add some macro definitions to check the GCC version, but in the mean time you could comment out the following lines in static_assert.h

#elif defined(ETL_COMPILER_GCC)
#define STATIC_ASSERT(Condition, Message) static_assert(Condition, Message)

I have a few other fixes and improvements to upload, but a glitch with Git just before I went away meant I will have to rebuild a few of them. :-(

from etl.

nlohmann avatar nlohmann commented on May 21, 2024

I am using g++-5 (Homebrew gcc5 5.4.0) 5.4.0 - this version supports static_assert.

from etl.

jwellbelove avatar jwellbelove commented on May 21, 2024

OK, I think I get what the problem is, but I'm not sure of the solution as yet.

from etl.

jwellbelove avatar jwellbelove commented on May 21, 2024

Does your configuration have -std=c++11 set?

from etl.

nlohmann avatar nlohmann commented on May 21, 2024

from etl.

jwellbelove avatar jwellbelove commented on May 21, 2024

The problem seems to be that GCC doesn't like this code...

template <std::size_t I, typename T, std::size_t MAXN>
inline T& get(array<T, MAXN>& a)
{
static_assert(I < MAXN, "Index out of bounds"); <<<<<<<<<<<<<<<<<<<
return a[I];
}

error: there are no arguments to 'static_assert' that depend on a template parameter, so a declaration of 'static_assert' must be available [-fpermissive]

The call to static assert already depends on template non-type parameters I & MAXN.
I'm assuming that it must depend on either 'a' or maybe the type T too?
I need to experiment.
You could either comment out the STATIC_ASSERT macro as previously mentioned of temporarily comment out the STATIC_ASSERTs in etl::array until I have a solution.

from etl.

jwellbelove avatar jwellbelove commented on May 21, 2024

I can only get this to fail if I select "-std=c++98"
If I select "-std=c++11" then I get no warnings.

from etl.

nlohmann avatar nlohmann commented on May 21, 2024

I tried again with the most recent release. The error does not occur any more. I am puzzled. Sorry for troubling you.

I now try to get the JSON library to compile with ETL.

from etl.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.