microsoft / microsoft/wil

Automatically setting variant type when assigning values

Open
#538 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C++
Stars
3k
Forks
300
Avg merge
19h 12m
Merged PRs (30d)
1

Description

wil::unique_variant could automatically set its vt member when assigning a value. I have 2 ways to approach this:

  1. Overload operator= directly in wil::unique_variant, so assigning a value automatically sets vt
wil::unique_variant value;
value = 42;
  1. Make all union member a setter function, eg.
wil::unique_variant value;
value.lVal(42);

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the definition of wil::unique_variant and inspect how its vt member and union members are currently handled. Compare the proposed operator= and setter approaches, then define completion as assigning a value causing vt to represent the assigned type without breaking existing usage.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
tooling
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.