fusion vector, spirit, phoenix actor and forwarding constructor

classic Classic list List threaded Threaded
9 messages Options
MM
Reply | Threaded
Open this post in threaded view
|

fusion vector, spirit, phoenix actor and forwarding constructor

MM
Hello,

In this user constructor for struct store in
/usr/include/boost/fusion/container/vector/vector.hpp:175:44

            template <typename U>
            BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
            store(U&& rhs
                , typename disable_if<is_same<typename pure<U>::type,
store>, detail::enabler_>::type = detail::enabler)
                : elem(std::forward<U>(rhs))
<= error is here
            {}

type of rhs is:
   const boost::phoenix::actor<boost::spirit::attribute<1> >&

the compiler meets this error:

no matching function for call to
‘boost::phoenix::actor<boost::spirit::attribute<1> >::actor(const
boost::spirit::attribute<1>&)’

candidates are the default ctor,
1) constexpr boost::phoenix::actor<boost::spirit::attribute<1> >::actor()

and the copy constructor
2) constexpr boost::phoenix::actor<boost::spirit::attribute<1>
>::actor(const boost::phoenix::actor<boost::spirit::attribute<1> >&)

This seems to be a problem only for >=c++11, also, it was ok with
1.58, but not now with develop.

I haven't managed to extract a small reproducible case yet, and but
i'll keep trying.

Thanks,

MM

------------------------------------------------------------------------------
What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
patterns at an interface-level. Reveals which users, apps, and protocols are
consuming the most bandwidth. Provides multi-vendor support for NetFlow,
J-Flow, sFlow and other flows. Make informed decisions using capacity planning
reports.http://sdm.link/zohodev2dev
_______________________________________________
Spirit-general mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/spirit-general
Reply | Threaded
Open this post in threaded view
|

Re: fusion vector, spirit, phoenix actor and forwarding constructor

Lee Clagett-2
On Tue, 12 Jul 2016 20:49:31 +0100 MM <[hidden email]> wrote:

> Hello,
>
> In this user constructor for struct store in
> /usr/include/boost/fusion/container/vector/vector.hpp:175:44
>
>             template <typename U>
>             BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
>             store(U&& rhs
>                 , typename disable_if<is_same<typename pure<U>::type,
> store>, detail::enabler_>::type = detail::enabler)  
>                 : elem(std::forward<U>(rhs))
> <= error is here
>             {}
>
> type of rhs is:
>    const boost::phoenix::actor<boost::spirit::attribute<1> >&
>
> the compiler meets this error:
>
> no matching function for call to
> ‘boost::phoenix::actor<boost::spirit::attribute<1> >::actor(const
> boost::spirit::attribute<1>&)’
>
> candidates are the default ctor,
> 1) constexpr boost::phoenix::actor<boost::spirit::attribute<1>
> >::actor()
>
> and the copy constructor
> 2) constexpr boost::phoenix::actor<boost::spirit::attribute<1>
> >::actor(const boost::phoenix::actor<boost::spirit::attribute<1> >&)  
>
> This seems to be a problem only for >=c++11, also, it was ok with
> 1.58, but not now with develop.
>
> I haven't managed to extract a small reproducible case yet, and but
> i'll keep trying.
>
> Thanks,
>
> MM
>

Does it work with Boost 1.61 or the master branch? Or is it only broken
on the develop branch? I made a recent pull request to `fusion::vector`
that fixed a few cases but broke single element nested cases:

  vector<int> internal;
  vector<vector<int>&> external(internal); // compile error on develop

I think this is _not_ the problem, but rather another one I am
simultaneously trying to fix with the above case - the C++11 vector
implementation in Boost 1.61 always returns true when it is the
destination type for `boost::is_convertible`. I am wondering whether the
type-traits change screws up Spirit in some way, but I have not taken
the time to determine if and how this would be problematic. I have
almost completed a solution which fixes both issues with no additional
runtime overhead (no additional unelidable-by-the-frontend move/copy),
and hopefully a minimal compile-time performance drop.

More information about this compile error would be useful. This will
either validate that SFINAE'ing available constructors is necessary, or
that there are other outstanding differences in behavior between the two
versions.

Lee

------------------------------------------------------------------------------
What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
patterns at an interface-level. Reveals which users, apps, and protocols are
consuming the most bandwidth. Provides multi-vendor support for NetFlow,
J-Flow, sFlow and other flows. Make informed decisions using capacity planning
reports.http://sdm.link/zohodev2dev
_______________________________________________
Spirit-general mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/spirit-general
MM
Reply | Threaded
Open this post in threaded view
|

Re: fusion vector, spirit, phoenix actor and forwarding constructor

MM


On 14 July 2016 at 02:23, Lee Clagett <[hidden email]> wrote:

> On Tue, 12 Jul 2016 20:49:31 +0100 MM <[hidden email]> wrote:
>> Hello,
>>
>> In this user constructor for struct store in
>> /usr/include/boost/fusion/container/vector/vector.hpp:175:44
>>
>>             template <typename U>
>>             BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
>>             store(U&& rhs
>>                 , typename disable_if<is_same<typename pure<U>::type,
>> store>, detail::enabler_>::type = detail::enabler)
>>                 : elem(std::forward<U>(rhs))
>> <= error is here
>>             {}
>>
>> type of rhs is:
>>    const boost::phoenix::actor<boost::spirit::attribute<1> >&
>>
>> the compiler meets this error:
>>
>> no matching function for call to
>> ‘boost::phoenix::actor<boost::spirit::attribute<1> >::actor(const
>> boost::spirit::attribute<1>&)’
>>
>> candidates are the default ctor,
>> 1) constexpr boost::phoenix::actor<boost::spirit::attribute<1>
>> >::actor()
>>
>> and the copy constructor
>> 2) constexpr boost::phoenix::actor<boost::spirit::attribute<1>
>> >::actor(const boost::phoenix::actor<boost::spirit::attribute<1> >&)
>>
>> This seems to be a problem only for >=c++11, also, it was ok with
>> 1.58, but not now with develop.
>>
>> I haven't managed to extract a small reproducible case yet, and but
>> i'll keep trying.
>>
>> Thanks,
>>
>> MM
>>

All compiled with g++6 c++11
> Does it work with Boost 1.61?
It hasn't work with vanilla boost 1.60 from my distro

> or the master branch?

> Or is it only broken on the develop branch?
It is broker in develop branch, but I am guilty of mix and match, so apologies for that,
I only took  boost 1.60 vanilla, and replaced phoenix spirit and fusion as links to the develop branch.
I will try again with entire boost develop, then with entire boost master.
Should I try with 1.61 vanilla as well?

I suppose I'd need to clone the entire boost repo, then switch branches between master and develop

is that git clone https://github.com/boostorg/boost.git

for now I only have clones of fusion phoenix and spirit.

While trying to make a smaller case, I've ran into I suppose a separate problem (likely unrelated) here:

https://stackoverflow.com/questions/38372392/boost-phoenix-eval-failures

The line closest to my real-code line that triggers the error above is:

start_ %= g2_(_r1);

Lee, here is a more complete stack that gets triggered from my real code:

startrule %= start(_r1);
qis::rule<Iterator, T*(T*), qis::blank_type> startrule;
qis::rule<Iterator, T*(T*), qis::locals<X*>, qis::blank_type> start;
/// where T and X are my application types.
The error stack is here:

Lee, let me know what to test please? Thanks


MM

------------------------------------------------------------------------------
What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
patterns at an interface-level. Reveals which users, apps, and protocols are
consuming the most bandwidth. Provides multi-vendor support for NetFlow,
J-Flow, sFlow and other flows. Make informed decisions using capacity planning
reports.http://sdm.link/zohodev2dev
_______________________________________________
Spirit-general mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/spirit-general
MM
Reply | Threaded
Open this post in threaded view
|

Re: fusion vector, spirit, phoenix actor and forwarding constructor

MM


On 14 July 2016 at 12:11, MM <[hidden email]> wrote:


On 14 July 2016 at 02:23, Lee Clagett <[hidden email]> wrote:

> On Tue, 12 Jul 2016 20:49:31 +0100 MM <[hidden email]> wrote:
>> Hello,
>>
>> In this user constructor for struct store in
>> /usr/include/boost/fusion/container/vector/vector.hpp:175:44
>>
>>             template <typename U>
>>             BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
>>             store(U&& rhs
>>                 , typename disable_if<is_same<typename pure<U>::type,
>> store>, detail::enabler_>::type = detail::enabler)
>>                 : elem(std::forward<U>(rhs))
>> <= error is here
>>             {}
>>
>> type of rhs is:
>>    const boost::phoenix::actor<boost::spirit::attribute<1> >&
>>
>> the compiler meets this error:
>>
>> no matching function for call to
>> ‘boost::phoenix::actor<boost::spirit::attribute<1> >::actor(const
>> boost::spirit::attribute<1>&)’
>>
>> candidates are the default ctor,
>> 1) constexpr boost::phoenix::actor<boost::spirit::attribute<1>
>> >::actor()
>>
>> and the copy constructor
>> 2) constexpr boost::phoenix::actor<boost::spirit::attribute<1>
>> >::actor(const boost::phoenix::actor<boost::spirit::attribute<1> >&)
>>
>> This seems to be a problem only for >=c++11, also, it was ok with
>> 1.58, but not now with develop.
>>
>> I haven't managed to extract a small reproducible case yet, and but
>> i'll keep trying.
>>
>> Thanks,
>>
>> MM
>>

All compiled with g++6 c++11
> Does it work with Boost 1.61?
It hasn't work with vanilla boost 1.60 from my distro

> or the master branch?

> Or is it only broken on the develop branch?
It is broker in develop branch, but I am guilty of mix and match, so apologies for that,
I only took  boost 1.60 vanilla, and replaced phoenix spirit and fusion as links to the develop branch.
I will try again with entire boost develop, then with entire boost master.
Should I try with 1.61 vanilla as well?

I suppose I'd need to clone the entire boost repo, then switch branches between master and develop

is that git clone https://github.com/boostorg/boost.git

for now I only have clones of fusion phoenix and spirit.

While trying to make a smaller case, I've ran into I suppose a separate problem (likely unrelated) here:

https://stackoverflow.com/questions/38372392/boost-phoenix-eval-failures

The line closest to my real-code line that triggers the error above is:

start_ %= g2_(_r1);

Lee, here is a more complete stack that gets triggered from my real code:

startrule %= start(_r1);
qis::rule<Iterator, T*(T*), qis::blank_type> startrule;
qis::rule<Iterator, T*(T*), qis::locals<X*>, qis::blank_type> start;
/// where T and X are my application types.
The error stack is here:

Lee, let me know what to test please? Thanks


MM

I managed to have a reproducible case and I updated the 
https://stackoverflow.com/questions/38372392/boost-phoenix-eval-failures
with the code.

Thanks
MM

------------------------------------------------------------------------------
What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
patterns at an interface-level. Reveals which users, apps, and protocols are
consuming the most bandwidth. Provides multi-vendor support for NetFlow,
J-Flow, sFlow and other flows. Make informed decisions using capacity planning
reports.http://sdm.link/zohodev2dev
_______________________________________________
Spirit-general mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/spirit-general
Reply | Threaded
Open this post in threaded view
|

Re: fusion vector, spirit, phoenix actor and forwarding constructor

Kohei Takahashi

MM,


While trying to make a smaller case, I've ran into I suppose a separate problem (likely unrelated) here:

https://stackoverflow.com/questions/38372392/boost-phoenix-eval-failures

The line closest to my real-code line that triggers the error above is:

start_ %= g2_(_r1);

Lee, here is a more complete stack that gets triggered from my real code:

startrule %= start(_r1);
qis::rule<Iterator, T*(T*), qis::blank_type> startrule;
qis::rule<Iterator, T*(T*), qis::locals<X*>, qis::blank_type> start;
/// where T and X are my application types.
The error stack is here:

Lee, let me know what to test please? Thanks


MM

I managed to have a reproducible case and I updated the 
https://stackoverflow.com/questions/38372392/boost-phoenix-eval-failures
with the code.

Thank you for your investigation. I'll check it.

Kohei


------------------------------------------------------------------------------
What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
patterns at an interface-level. Reveals which users, apps, and protocols are
consuming the most bandwidth. Provides multi-vendor support for NetFlow,
J-Flow, sFlow and other flows. Make informed decisions using capacity planning
reports.http://sdm.link/zohodev2dev
_______________________________________________
Spirit-general mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/spirit-general

signature.asc (860 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: fusion vector, spirit, phoenix actor and forwarding constructor

Lee Clagett-2
On Sun, 17 Jul 2016 14:54:15 +0900
Kohei Takahashi <[hidden email]> wrote:

> MM,
>
>
> >     While trying to make a smaller case, I've ran into I suppose a
> >     separate problem (likely unrelated) here:
> >
> >     https://stackoverflow.com/questions/38372392/boost-phoenix-eval-failures
> >
> >     The line closest to my real-code line that triggers the error
> >     above is:
> >
> >     start_ %= g2_(_r1);
> >
> >     Lee, here is a more complete stack that gets triggered from my
> >     real code:
> >
> >     startrule %= start(_r1);
> >     qis::rule<Iterator, T*(T*), qis::blank_type> startrule;
> >     qis::rule<Iterator, T*(T*), qis::locals<X*>, qis::blank_type>
> > start; /// where T and X are my application types.
> >     The error stack is here:
> >
> >     http://paste.fedoraproject.org/391037/46849462
> >     http://paste.fedoraproject.org/391037/46849462
> >     Lee, let me know what to test please? Thanks
> >
> >
> >     MM
> >
> >
> > I managed to have a reproducible case and I updated the
> > https://stackoverflow.com/questions/38372392/boost-phoenix-eval-failures
> > with the code.
>
> Thank you for your investigation. I'll check it.
>

Someone sent me a more limited failure case:

    int main() {
        auto iter = boost::phoenix::val(str.begin());
        boost::fusion::make_vector(iter);
    }

This was caused entirely by my last patch, which is found only on the
develop branch. If the OP had errors with Boost 1.60-1.61 it is likely
a separate but related issue that I attempted to fix in my patch.

Kohei - I started investigating the problem before this thread started
after I discovered the issue myself. Eventually I started
[experimenting with `fusion::vector`][0]. I do not plan on merging that
branch directly; there is a lot going on and some of the changes
intended for compile time performance have not been analyzed. Instead, I
will start with smaller patches, with the focus being [adding SFINAE to
the tuple and vector constructors][1]. Email me directly if you have
any different thoughts on fixing this.

Lee

[0]https://github.com/boostorg/fusion/compare/develop...vtnerd:experimental/vector
[1]https://github.com/boostorg/fusion/compare/develop...vtnerd:experimental/vector#diff-685c7cd829c2781da56b16d34a35526dR300

------------------------------------------------------------------------------
What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
patterns at an interface-level. Reveals which users, apps, and protocols are
consuming the most bandwidth. Provides multi-vendor support for NetFlow,
J-Flow, sFlow and other flows. Make informed decisions using capacity planning
reports.http://sdm.link/zohodev2dev
_______________________________________________
Spirit-general mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/spirit-general
MM
Reply | Threaded
Open this post in threaded view
|

Re: fusion vector, spirit, phoenix actor and forwarding constructor

MM


On 18 July 2016 at 06:28, Lee Clagett <[hidden email]> wrote:
On Sun, 17 Jul 2016 14:54:15 +0900
Kohei Takahashi <[hidden email]> wrote:

> MM,
>
>
> >     While trying to make a smaller case, I've ran into I suppose a
> >     separate problem (likely unrelated) here:
> >
> >     https://stackoverflow.com/questions/38372392/boost-phoenix-eval-failures
> >
> >     The line closest to my real-code line that triggers the error
> >     above is:
> >
> >     start_ %= g2_(_r1);
> >
> >     Lee, here is a more complete stack that gets triggered from my
> >     real code:
> >
> >     startrule %= start(_r1);
> >     qis::rule<Iterator, T*(T*), qis::blank_type> startrule;
> >     qis::rule<Iterator, T*(T*), qis::locals<X*>, qis::blank_type>
> > start; /// where T and X are my application types.
> >     The error stack is here:
> >
> >     http://paste.fedoraproject.org/391037/46849462
> >     http://paste.fedoraproject.org/391037/46849462
> >     Lee, let me know what to test please? Thanks
> >
> >
> >     MM
> >
> >
> > I managed to have a reproducible case and I updated the
> > https://stackoverflow.com/questions/38372392/boost-phoenix-eval-failures
> > with the code.
>
> Thank you for your investigation. I'll check it.
>

Someone sent me a more limited failure case:

    int main() {
        auto iter = boost::phoenix::val(str.begin());
        boost::fusion::make_vector(iter);
    }

This was caused entirely by my last patch, which is found only on the
develop branch. If the OP had errors with Boost 1.60-1.61 it is likely
a separate but related issue that I attempted to fix in my patch.

Kohei - I started investigating the problem before this thread started
after I discovered the issue myself. Eventually I started
[experimenting with `fusion::vector`][0]. I do not plan on merging that
branch directly; there is a lot going on and some of the changes
intended for compile time performance have not been analyzed. Instead, I
will start with smaller patches, with the focus being [adding SFINAE to
the tuple and vector constructors][1]. Email me directly if you have
any different thoughts on fixing this.

Lee

[0]https://github.com/boostorg/fusion/compare/develop...vtnerd:experimental/vector
[1]https://github.com/boostorg/fusion/compare/develop...vtnerd:experimental/vector#diff-685c7cd829c2781da56b16d34a35526dR300

I had no errors with boost 1.58 g++ 5.3 c++11
then i upgraded my fedora and had errors with boost 1.60 g++6.1 c++11
then i tried with spirit/phoenix/fusion from develop (maybe it doesn't make sense:-)
note develop+g++6.1 + c++03 works fine

MM

------------------------------------------------------------------------------
What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
patterns at an interface-level. Reveals which users, apps, and protocols are
consuming the most bandwidth. Provides multi-vendor support for NetFlow,
J-Flow, sFlow and other flows. Make informed decisions using capacity planning
reports.http://sdm.link/zohodev2dev
_______________________________________________
Spirit-general mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/spirit-general
MM
Reply | Threaded
Open this post in threaded view
|

Re: fusion vector, spirit, phoenix actor and forwarding constructor

MM
In reply to this post by Lee Clagett-2
On 18 July 2016 at 06:28, Lee Clagett <[hidden email]> wrote:
On Sun, 17 Jul 2016 14:54:15 +0900
Kohei Takahashi <[hidden email]> wrote:

> MM,
>
>
> >     While trying to make a smaller case, I've ran into I suppose a
> >     separate problem (likely unrelated) here:
> >
> >     https://stackoverflow.com/questions/38372392/boost-phoenix-eval-failures
> >
> >     The line closest to my real-code line that triggers the error
> >     above is:
> >
> >     start_ %= g2_(_r1);
> >
> >     Lee, here is a more complete stack that gets triggered from my
> >     real code:
> >
> >     startrule %= start(_r1);
> >     qis::rule<Iterator, T*(T*), qis::blank_type> startrule;
> >     qis::rule<Iterator, T*(T*), qis::locals<X*>, qis::blank_type>
> > start; /// where T and X are my application types.
> >     The error stack is here:
> >
> >     http://paste.fedoraproject.org/391037/46849462
> >     http://paste.fedoraproject.org/391037/46849462
> >     Lee, let me know what to test please? Thanks
> >
> >
> >     MM
> >
> >
> > I managed to have a reproducible case and I updated the
> > https://stackoverflow.com/questions/38372392/boost-phoenix-eval-failures
> > with the code.
>
> Thank you for your investigation. I'll check it.
>

Someone sent me a more limited failure case:

    int main() {
        auto iter = boost::phoenix::val(str.begin());
        boost::fusion::make_vector(iter);
    }

This was caused entirely by my last patch, which is found only on the
develop branch. If the OP had errors with Boost 1.60-1.61 it is likely
a separate but related issue that I attempted to fix in my patch.

Lee I just tried with  vanilla 1.60 and I confirm it's indeed working in c++11.
But I have other parts of my code that failed with 1.60 that your patch fixed for me.

Let me should you want me to test any solution you find

rds,
MM

------------------------------------------------------------------------------
What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
patterns at an interface-level. Reveals which users, apps, and protocols are
consuming the most bandwidth. Provides multi-vendor support for NetFlow,
J-Flow, sFlow and other flows. Make informed decisions using capacity planning
reports.http://sdm.link/zohodev2dev
_______________________________________________
Spirit-general mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/spirit-general
Reply | Threaded
Open this post in threaded view
|

Re: fusion vector, spirit, phoenix actor and forwarding constructor

Kohei Takahashi
In reply to this post by Lee Clagett-2
Hi Lee,


> Kohei - I started investigating the problem before this thread started
> after I discovered the issue myself. Eventually I started
> [experimenting with `fusion::vector`][0]. I do not plan on merging that
> branch directly; there is a lot going on and some of the changes
> intended for compile time performance have not been analyzed. Instead, I
> will start with smaller patches, with the focus being [adding SFINAE to
> the tuple and vector constructors][1]. Email me directly if you have
> any different thoughts on fixing this.
>
> Lee
>
> [0]https://github.com/boostorg/fusion/compare/develop...vtnerd:experimental/vector
> [1]https://github.com/boostorg/fusion/compare/develop...vtnerd:experimental/vector#diff-685c7cd829c2781da56b16d34a35526dR300
I think the implementation is good, but not only fusion::vector but also
other containers, interfaces of constructors and assignments are not
consistent. I think those needs to be refreshed entirely, like this
https://gist.github.com/Flast/7b60b178c18fa90e2a183d4802289a87 .

off topic: I really dislike sequence conversion ctor, it makes SFINAE
too complex...

Kohei


------------------------------------------------------------------------------
What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
patterns at an interface-level. Reveals which users, apps, and protocols are
consuming the most bandwidth. Provides multi-vendor support for NetFlow,
J-Flow, sFlow and other flows. Make informed decisions using capacity planning
reports.http://sdm.link/zohodev2dev
_______________________________________________
Spirit-general mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/spirit-general

signature.asc (860 bytes) Download Attachment