Git Product home page Git Product logo

Comments (2)

RenechCDDA avatar RenechCDDA commented on July 18, 2024

I tried to do it myself by copying and adjusting the "-=" operator in coordinates.h, but that blew up substantially with messages of "'r': identifier not found" in coordinates.h from every existing usage of the binary "-" operator.

You got this on a branch? I might be able to put something together.

from cataclysm-dda.

PatrikLundell avatar PatrikLundell commented on July 18, 2024

No, but I tried to quickly recreate it, although it's not quite the same, but still failing:
I entered this into coordinates.h:

template<typename Point, origin relative, scale Scale>
constexpr inline coord_point<Point, origin::relative, Scale>& operator-(coord_point<Point, origin::relative, Scale>
    & me )
{
    me.raw() = -me.raw();
    return me;
}

that compiles. However, trying to use it by adding:

    tripoint_rel_ms alpha = { 1, 2, 3 };
    tripoint_rel_ms beta = -alpha;

to a "random" location such as the top of mapgen.cpp operation add_spawn causes the editor to think it's OK, but the compiler to reject it with
"Severity Code Description Project File Line Suppression State Details
Error C2675 unary '-': 'tripoint_rel_ms' does not define this operator or a conversion to a type acceptable to the predefined operator Cataclysm-lib-vcpkg-static C:\Cataclysm-DDA\src\mapgen.cpp 6807"
and
"Severity Code Description Project File Line Suppression State Details
Error C2088 built-in operator '-' cannot be applied to an operand of type 'tripoint_rel_ms' Cataclysm-lib-vcpkg-static C:\Cataclysm-DDA\src\mapgen.cpp 6807"
where 6807 is the line on which beta is defined.

from cataclysm-dda.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.