linksplatform / Interfaces

LinksPlatform's Platform.Interfaces Class Library
https://linksplatform.github.io/Interfaces
The Unlicense
3 stars 2 forks source link

Sweep: Add `CLinkAddress` concept #113

Closed FreePhoenix888 closed 1 year ago

FreePhoenix888 commented 1 year ago

Sweep: Add CLinkAddress concept to cpp/Platform.Interfaces/. CLinkAddress must check that argument is integral and unsigned

Checklist - [X] `cpp/Platform.Interfaces/CLinkAddress.h` ✅ Commit [`0e26908`](https://github.com/linksplatform/Interfaces/commit/0e26908532dcdd83daf15f39fe71aefff811625e)
• Include the `` and `` libraries at the beginning of the file. • Define the `Platform::Interfaces` namespace. • Inside the namespace, define the `CLinkAddress` concept that takes a single template argument `T`. • The concept should check if `T` is both integral and unsigned using `std::is_integral` and `std::is_unsigned` respectively.
linksplatform-sweepai[bot] commented 1 year ago

Here's the PR! https://github.com/linksplatform/Interfaces/pull/116.

💎 Sweep Pro: I used GPT-4 to create this ticket. You have unlimited GPT-4 tickets.

Actions (click)


Step 1: 🔎 Searching

I found the following snippets in your repository. I will now analyze these snippets and come up with a plan.

Some code snippets I looked at (click to expand). If some file is missing from here, you can mention the path in the ticket description. https://github.com/linksplatform/Interfaces/blob/825997338e0852ecada7cfcfc58da7f7d918e80c/cpp/Platform.Interfaces/CSet.h#L1-L52 https://github.com/linksplatform/Interfaces/blob/825997338e0852ecada7cfcfc58da7f7d918e80c/cpp/Platform.Interfaces/CDictionary.h#L1-L77 https://github.com/linksplatform/Interfaces/blob/825997338e0852ecada7cfcfc58da7f7d918e80c/cpp/Platform.Interfaces/ICounter[TResult].h#L1-L12 https://github.com/linksplatform/Interfaces/blob/825997338e0852ecada7cfcfc58da7f7d918e80c/cpp/Platform.Interfaces/IFactory.h#L1-L12 https://github.com/linksplatform/Interfaces/blob/825997338e0852ecada7cfcfc58da7f7d918e80c/cpp/Platform.Interfaces/ICriterionMatcher.h#L1-L12

Step 2: ⌨️ Coding


Step 3: 🔁 Code Review

I have finished reviewing the code for completeness. I did not find errors for sweep/add-clinkaddress-concept.

.


🎉 Latest improvements to Sweep:


💡 To recreate the pull request edit the issue title or description. To tweak the pull request, leave a comment on the pull request. Join Our Discord

FreePhoenix888 commented 1 year ago

Sweep: you should write C++ concept, not struct! Here is an example of C++ concept:

#pragma once

#include <concepts>

namespace Platform::Interfaces {
  template <typename TSelf, typename TValue, typename... TArgument>
  concept CSetter = sizeof...(TArgument) <= 1 && requires(TSelf self, TArgument... argument, TValue value) {
    { self.Set(argument..., value) } -> std::same_as<void>;
  };
}