|
Boost Users : |
Subject: [Boost-users] Possible Boost.Variant issue with JSON AST
From: Michael Powell (mwpowellhtx_at_[hidden])
Date: 2019-01-10 18:36:57
Hello,
I've got an AST I am developing to support JSON parsing using the
latest VC++ (15.9.5), however, I am having difficulty persuading the
compiler with my forward declarations.
i.e. 1>d:\dev\boost.org\boost_1_69_0\boost\mpl\sizeof.hpp(27): error
C2027: use of undefined type 'kingdom::json::object_t'
In terms of JSON AST modeling, the rub appears to be in a couple of
places: defining the JSON AST Array, and making the JSON AST Object
available to Value. Re: semantic terminology, Value is interchangeable
with Element, in view of the JSON grammar.
Here's my attempt at a flattened single source example:
https://wandbox.org/permlink/83c3VXZ4W1DHoEBc
I seem to recall there being future issues with C++ forward
declarations, but this seems to be like a bad language design decision
to restrict this, especially in light of this kind of approach.
I'm not sure how better to sort this out. At minimum, at least Value
needs a forward declaration depending on how I arrange my headers,
includes, etc. But then I still run into Value forward declaration
undefined type issues.
I'm not sure it's as much a language issue as much as it is possible a
Boost.Variant issue, per se.
Suggestions?
Thanks!
Michael Powell
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net