Home
Blogs
Questions
Jobs
Monetize

Home

About Us

Blogs

Questions

Jobs

Monetize

Post Job

banner

Questions about default-arguments

Read more about default-arguments

python (12.9k questions)

javascript (9.2k questions)

reactjs (4.7k questions)

java (4.2k questions)

java (4.2k questions)

c# (3.5k questions)

c# (3.5k questions)

html (3.3k questions)

Questions - default-arguments

Using std::nullopt as a default value for an std::optional argument in C++17

This is a standard / good coding practice question. I've recently started using std::optional in my codebase. I think it's great (and verbose) for specifying an argument that's optional, so long as a ...
test-img

heothesennoc

c++

c++17

default-arguments

stdoptional

Votes: 0

Answers: 1

Latest Answer

Yes, that is perfectly fine. It may be slightly verbose, but the interface is very clear. The only problem is that if someone wants to specify the last optional parameter, they will also have to spec...
test-img

Ayxan Haqverdili

Default parameter in a function wouldnt compile/link without static inline

i was writing a BST class in C++ and wanted to add a default parameter to a function but, when i tried to the visual studio compiler gave compile and linking errors, so after a bit of googling, i made...
test-img

Programvarg

c++

c++17

binary-search-tree

function-declaration

default-arguments

Votes: 0

Answers: 2

Latest Answer

According to the C++ 20 Standard (9.3.4.7 Default arguments) ...A non-static member shall not appear in a default argument unless it appears as the id-expression of a class member access expression ...
test-img

Vlad from Moscow

Posts

Questions

Blogs

Jobs

The ultimate platform for coders and IT specialists

About

  • Company
  • Support

  • Platform

  • Terms & Conditions
  • Privacy statement
  • Cookie policy
  • Cookie option
  • OnlyCoders © 2025  |  All rights reserved