Skip to content

Lose space before && in template #1002

Closed

Description

@jlee975

But not in the definition of value

template< class B1 = void, class B2 = void >
struct conjunction : foo< B1::value && B2::value >
{
	static const bool value = B1::value && B2::value;
};

See conditional.cpp, conditional.cpp.uncrustify, conditional.debug in https://github.com/jlee975/uncrustify-tests

Using uncrustify v0.64_d 1f53888

Activity

  1. CDanU commented on Feb 10, 2017

    @CDanU
    Collaborator

    This is caused by sp_before_byref = remove.

    I am not entirely sure what the && in

    struct conjunction : foo< B1::value && B2::value >

    are supposed to mean.

  2. jlee975 commented on Feb 11, 2017

    @jlee975
    ContributorAuthor

    It's boolean AND, just as if it were in (true && false).

  3. guy-maurel commented on Mar 17, 2017

    @guy-maurel
    Contributor

    Could please push a complete example. I would like to compile and run it.

  4. jlee975 commented on Mar 17, 2017

    @jlee975
    ContributorAuthor

    I"ve updated conditional.cpp, etc in https://github.com/jlee975/uncrustify-tests

    Uncrustify version from commit 766207c

    It is a simple implementation of std::conjunction from C++17

  5. guy-maurel commented on Mar 17, 2017

    @guy-maurel
    Contributor

    We don't support C++17 now.
    But, if you want to join us, we will be very happy.

  6. jlee975 commented on Mar 17, 2017

    @jlee975
    ContributorAuthor

    Sorry, that's not what I meant. The code will compile under C++03.

    I maintain a project (cppbackport) that implements C++11/14/17 stuff in C++03, so that's ultimately where it came from. I was just mentioning what the code does, if you were going to run it.

  7. guy-maurel commented on May 4, 2017

    @guy-maurel
    Contributor
  8. jlee975 commented on May 4, 2017

    @jlee975
    ContributorAuthor

    Sorry, I think the use of conjunction has confused things. The issue doesn't really have anything to do with std::conjunction except that I chose to use it for the example.

    The issue is that for

    struct conjunction : foo< B1::value && B2::value >
    

    the && is formatted with sp_before_byref/sp_after_byref when it should be sp_arith

  9. added a commit that references this issue on May 8, 2017
  10. guy-maurel commented on May 8, 2017

    @guy-maurel
    Contributor

    A proposal is PR#1141

  11. added a commit that references this issue on May 11, 2017
  12. gmaurel commented on May 11, 2017

    @gmaurel
    Collaborator

    is fixed

  13. jlee975 commented on May 11, 2017

    @jlee975
    ContributorAuthor

    Thanks for your help with this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions