Re: coliru.stacked-crooked.com

Mikael Asplund <[email protected]>
Newsgroups gmane.comp.parsers.spirit.general
Message-ID <[email protected]>
Hi Mario!

Sorry about that, forgot to attach the source also. 

I have posted a bug with example on Microsoft's connect site:

https://connect.microsoft.com/VisualStudio/Feedback/Details/2486073

In general, Microsoft is working hard on bringing their compiler into this century, and SFINAE issues are right up there for them. That's why I'm not too worried myself, as I don't have to release my code for windows any time soon, and I'm therefor fine with running betas, having work arounds for a while, etc. One thing you should know is that the BOOST_SPIRIT_DEFINE() macro doesn't work on VS2015. I'm using my own macro for that part... more in another post soon. :-)

Attaching the source code to this mail.

  /Mikael

-----Original Message-----
From: Mario Lang [mailto:[email protected]] 
Sent: Friday, March 18, 2016 13:57
To: Spirit General Mailing List <[email protected]>
Subject: [Spirit-general] coliru.stacked-crooked.com

Mikael Asplund <[email protected]> writes:

> To follow up on this:
>
> Made a minimal example online (also attached):
>
> http://coliru.stacked-crooked.com/a/208eaadc853b0d6d

I am not able to use that site due to heavy javascript use.
They do not offer a fallback to at least get the source code snippet.

I am aware that I am probably not able to stop these sort of developments, but I still wanted to mention that at least one semi-active member of this list is blind, and has serious accessibility issues with coliru.stacked-crooked.com.  All code examples posted to this list via this site I can not read.

It would have been interesting, since I am planning to move to X3 on my Linux/Mac/Windows project.  I do make use of annotate_on_success for the typical error_handler.get_position() pattern.

Reading that Joel has apparently completely given up on MSVC is a big showstopper for me right now.  While I would love to, I can not move forward on adopting X3 if this bug persists.

--
CYa,
  ⡍⠁⠗⠊⠕

------------------------------------------------------------------------------
Transform Data into Opportunity.
Accelerate data analysis in your applications with Intel Data Analytics Acceleration Library.
Click to learn more.
http://pubads.g.doubleclick.net/gampad/clk?id=278785231&iu=/4140
_______________________________________________
Spirit-general mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/spirit-general

------------------------------------------------------------------------------
Transform Data into Opportunity.
Accelerate data analysis in your applications with
Intel Data Analytics Acceleration Library.
Click to learn more.
http://pubads.g.doubleclick.net/gampad/clk?id=278785231&iu=/4140

_______________________________________________
Spirit-general mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/spirit-general
on_success_bug.cpp (text/plain, 2.9 KB)
#include iostream
#include string
#include vector
#include boostspirithomex3.hpp
#include boostspirithomex3supportutilityannotate_on_success.hpp

using stdstring;
using stdvector;
using stdpair;

namespace x3 = boostspiritx3;

namespace ast {
  struct Identifier {};
}

typedef vectorstringconst_iterator iterator_type;

struct my_annotate {
  inline void on_success(iterator_type const& first, iterator_type const& last, astIdentifier& a, x3unused_type const& context) {
    stdcout  kitty  stdendl;
  }
};

struct XXX  x3annotate_on_success {};
struct YYY  my_annotate {};

template typename Expr, typename T = void
struct disable_if_substitution_failure {
  typedef T type;
};

template typename ID, typename Iterator, typename Attribute, typename Context, typename Enable = void
struct my_has_on_success  boostmplfalse_ {};

template typename ID, typename Iterator, typename Attribute, typename Context
struct my_has_on_successID, Iterator, Context, Attribute,
  typename disable_if_substitution_failure
  decltype(
    stddeclvalID().on_success(
      stddeclvalIterator&()
      , stddeclvalIterator()
      , stddeclvalAttribute&()
      , stddeclvalContext()
      )
    )type

   boostmpltrue_ {};

template typename ID, typename Iterator, typename Attribute, typename Context, typename Enable = void
struct x3_has_on_success  boostmplfalse_ {};

template typename ID, typename Iterator, typename Attribute, typename Context
struct x3_has_on_successID, Iterator, Context, Attribute,
  typename x3disable_if_substitution_failure
  decltype(
    stddeclvalID().on_success(
      stddeclvalIterator&()
      , stddeclvalIterator()
      , stddeclvalAttribute&()
      , stddeclvalContext()
      )
    )type

   boostmpltrue_ {};

int main() {
  auto y1 = my_has_on_successYYY, iterator_type, x3unused_type, astIdentifier&();
  auto y2 = x3_has_on_successYYY, iterator_type, x3unused_type, astIdentifier&();
  auto y3 = x3detailhas_on_successYYY, iterator_type, x3unused_type, astIdentifier&();
  auto x1 = my_has_on_successXXX, iterator_type, x3unused_type, astIdentifier&();
  auto x2 = x3_has_on_successXXX, iterator_type, x3unused_type, astIdentifier&();
  auto x3 = x3detailhas_on_successXXX, iterator_type, x3unused_type, astIdentifier&();
  typedef decltype(XXX().on_success(stddeclvaliterator_type&(), stddeclvaliterator_type(), stddeclvalastIdentifier&(), x3unused)) type;
  typedef decltype(YYY().on_success(stddeclvaliterator_type&(), stddeclvaliterator_type(), stddeclvalastIdentifier&(), x3unused)) type;
  bool b1 = x1;
  bool b2 = x2;
  bool b3 = x3;
  bool b4 = y1;
  bool b5 = y2;
  bool b6 = y3;
  stdcout  x me     b1  stdendl;
  stdcout  x x3     b2  stdendl;
  stdcout  x real   b3  stdendl;
  stdcout  y me     b4  stdendl;
  stdcout  y x3     b5  stdendl;
  stdcout  y real   b6  stdendl;
  return 0;
}
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.