GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — extending codegen to support instantiations of arbitrary templates · Issue #726 · DFHack/df-structures

extending codegen to support instantiations of arbitrary templates #726

New issue
Copy link
New issue
Copy link
Open
Open
extending codegen to support instantiations of arbitrary templates#726
Copy link

Description

@ab9rf
ab9rf
opened on Mar 1, 2024
Issue body actions

at the moment i'm looking at something akin to this:

<template-instance template-name='name'>
contents are then either
<type-parameter>
a simple type
or
a compound (which will be redued to a T_ type and used as the parameter)
or
a subordinate template-instance (for nested template instances)
</type-parameter>
or
<type-parameter type-name='...'/> which is a shorthand
this is repeated as many times as appropriate
</template-instance>

<stl-variant> would then be an alias for <template-instance template-name='std::variant'>

there's a further extension (to be done later) for dealing with function types (which is what the type parameter of std::function is) that i'm thinking will be repurposing the existing vmethod tag

we'll probably eventually want to be able to declare templates as well; there is at least one template type in g_src now -- we're ignoring that it's a template because all of the instances are binary-compatible so we can pretend they're all the same type, but this can't be counted on being the case forever, but this isn't immediately needed so that's a future thought

anyway, thoughts welcome none of this is set in stone, and i got nowhere when i tried a first pass at implementing this yesterday so i'm still at square one in this regard

Originally posted by @ab9rf in #686 (comment)

Activity

  1. myk002
    added this to 50.12-r2on Mar 2, 2024
  2. github-project-automation
    moved this to Todo in 50.12-r2on Mar 2, 2024
  3. myk002
    removed this from 50.12-r2on Mar 2, 2024
  4. lethosor commented on May 17, 2024

    @lethosor
    lethosor
    on May 17, 2024
    Member
    More actions

    a compound (which will be redued to a T_ type and used as the parameter)

    My guess is that this can be a lower priority. We can always define our own types, and defining types inline in template arguments isn't valid like it is for class fields - neither of these compile:

    std::vector<struct { field a; }>
    std::variant<struct { field a; }, struct { field b; }>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402520 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.