Skip to content

Fix removing parens for in-place objects - quick fix of #331 #335

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 14, 2023

Conversation

filipsajdak
Copy link
Contributor

That should cover cases:

    f1(:std::vector=(1,2,3));
    f2(:std::vector=(1,2,3),:std::vector=(4,5));
    ar[:index=(1,2)];
    ar2[:index=(1,2), :index=(2,1)];

that will generate:

    f1(std::vector{1, 2, 3});
    f2(std::vector{1, 2, 3}, std::vector{4, 5});
    cpp2::assert_in_bounds(ar, index{1, 2});
    cpp2::assert_in_bounds(ar2, index{1, 2}, index{2, 1});

@filipsajdak filipsajdak force-pushed the fsajdak-quick-fix-of-331 branch from 32e314d to 85403bc Compare April 9, 2023 23:03
That should cover cases:
```cpp
    f1(:std::vector=(1,2,3));
    f2(:std::vector=(1,2,3),:std::vector=(4,5));
    ar[:index=(1,2)];
    ar2[:index=(1,2), :index=(2,1)];
```
that will generate:
```cpp
    f1(std::vector{1, 2, 3});
    f2(std::vector{1, 2, 3}, std::vector{4, 5});
    cpp2::assert_in_bounds(ar, index{1, 2});
    cpp2::assert_in_bounds(ar2, index{1, 2}, index{2, 1});
```
@filipsajdak filipsajdak force-pushed the fsajdak-quick-fix-of-331 branch from 85403bc to d3fda5a Compare April 10, 2023 15:08
@hsutter hsutter merged commit 56ce565 into hsutter:main Apr 14, 2023
@filipsajdak filipsajdak deleted the fsajdak-quick-fix-of-331 branch April 15, 2023 00:21
zaucy pushed a commit to zaucy/cppfront that referenced this pull request Dec 5, 2023
That should cover cases:
```cpp
    f1(:std::vector=(1,2,3));
    f2(:std::vector=(1,2,3),:std::vector=(4,5));
    ar[:index=(1,2)];
    ar2[:index=(1,2), :index=(2,1)];
```
that will generate:
```cpp
    f1(std::vector{1, 2, 3});
    f2(std::vector{1, 2, 3}, std::vector{4, 5});
    cpp2::assert_in_bounds(ar, index{1, 2});
    cpp2::assert_in_bounds(ar2, index{1, 2}, index{2, 1});
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants