Skip to content
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

'and' operator in cpp code? #7

Open
lab313ru opened this issue Feb 12, 2016 · 3 comments
Open

'and' operator in cpp code? #7

lab313ru opened this issue Feb 12, 2016 · 3 comments

Comments

@lab313ru
Copy link
Contributor

For example (icode.h):

bool matchWithRegDst(llIcode op)
{
    return (getOpcode()==op) and m_dst.isReg();
}

I cannot compile it. And there are many other operands too.

@nemerle
Copy link
Owner

nemerle commented Feb 12, 2016

Sorry, this is standard C++, but MSVC does not handle it properly. You'll have to disable the language extensions to get it to work ( Yes enabling extensions removes support for parts of the standard 😦 )

I find that using or/not/and keywords helps me avoid bugs ( & vs &&) and makes the code more readable.

@lab313ru
Copy link
Contributor Author

Could you make your code more different compilers compatible? I mean use only && instead of mixing && and and.

@nemerle
Copy link
Owner

nemerle commented Feb 12, 2016

I'm developing all my code under Linux with clang/gcc and currently have no access to a VisualStudio development environment.
I'll be happy to accept a PR 😄

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

No branches or pull requests

2 participants