Skip to content

Main - #25

Open
Wiseung wants to merge 1 commit into
LearningInfiniTensor:mainfrom
Wiseung:main
Open

Main#25
Wiseung wants to merge 1 commit into
LearningInfiniTensor:mainfrom
Wiseung:main

Conversation

@Wiseung

Copy link
Copy Markdown

learn-cxx测试

CopilotAI review requested due to automatic review settings January 4, 2026 10:13

CopilotAI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR implements solutions for a series of C++ learning exercises (learn-cxx), progressing from basic syntax to advanced topics including STL containers, templates, and move semantics. The changes fill in TODO comments and placeholders with working implementations to make the test assertions pass.

Key Changes

  • Completed 34 C++ exercises covering fundamental concepts (variables, functions, classes) through advanced topics (templates, smart pointers, STL algorithms)
  • Implemented proper memory management patterns including destructors, copy constructors, and move semantics
  • Added correct usage of STL containers (vector, array, map) and algorithms (transform, accumulate)

Reviewed changes

Copilot reviewed 34 out of 34 changed files in this pull request and generated no comments.

Show a summary per file
FileDescription
exercises/00_hello_world/main.cppFixed syntax error in cout statement
exercises/01_variable&add/main.cppChanged exercise from variable addition to hello world output
exercises/02_function/main.cppAdded function declaration and implementation for add function
exercises/03_argument&parameter/main.cppFilled in correct assertion values for pass-by-value demonstration
exercises/04_static/main.cppFilled in expected values for static variable behavior
exercises/05_constexpr/main.cppImplemented iterative fibonacci and changed constexpr to const for compilation
exercises/06_array/main.cppCompleted ternary expression for cached fibonacci calculation
exercises/07_loop/main.cppImplemented array-based fibonacci with caching logic
exercises/08_pointer/main.cppImplemented pointer stride logic for fibonacci sequence validation
exercises/09_enum&union/main.cppCompleted type punning conversion using union
exercises/10_trivial/main.cppFixed struct member access and initialization for cache
exercises/11_method/main.cppImplemented caching logic in struct method and initialization
exercises/12_method_const/main.cppAdded const qualifier to method signature
exercises/13_class/main.cppImplemented class constructor with array initialization
exercises/14_class_destruct/main.cppImplemented constructor and destructor for dynamic memory
exercises/15_class_clone/main.cppImplemented copy constructor for deep copying
exercises/16_class_move/main.cppImplemented move constructor and move assignment operator
exercises/17_class_derive/main.cppFilled in static_assert values for inheritance size calculations
exercises/18_class_virtual/main.cppFilled in expected values for virtual function behavior
exercises/19_class_virtual_destruct/main.cppFixed static member initialization and added virtual destructor
exercises/20_function_template/main.cppConverted function to template and fixed floating-point comparison
exercises/21_runtime_datatype/main.cppTemplated sigmoid function and implemented tagged union dispatch
exercises/22_class_template/main.cppImplemented broadcasting addition for 4D tensor class template
exercises/23_template_const/main.cppImplemented shape initialization and index calculation for templated tensor
exercises/24_std_array/main.cppFilled in correct values for std::array usage
exercises/25_std_vector/main.cppCompleted std::vector operations and assertions
exercises/26_std_vector_bool/main.cppImplemented std::vector specialization usage
exercises/27_strides/main.cppImplemented stride calculation for contiguous tensor storage
exercises/28_std_string/main.cppFilled in type assertions and string concatenation
exercises/29_std_map/main.cppImplemented map lookup and insertion functions
exercises/30_std_unique_ptr/main.cppAnalyzed and filled in unique_ptr lifecycle patterns
exercises/31_std_shared_ptr/main.cppFilled in reference count values for shared_ptr operations
exercises/32_std_transform/main.cppImplemented std::transform with lambda for vector transformation
exercises/33_std_accumulate/main.cppImplemented std::accumulate for tensor byte size calculation

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@Wiseung