Home
Blogs
Questions
Jobs
Monetize

Home

About Us

Blogs

Questions

Jobs

Monetize

Post Job

banner

Questions about narrowing

Read more about narrowing

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 - narrowing

GCC, clang disagree with MSVC on narrowing conversion

Consider the following program: struct uint1 { unsigned x; uint1(unsigned x_) : x(x_) { } }; struct foo { uint1 a; }; foo f(int v) { return {v}; } struct bar { unsigned a; }; bar g(i...
test-img

einpoklum

c++

gcc

visual-c++

compiler-warnings

narrowing

Votes: 0

Answers: 1

Latest Answer

It seems that GCC and Clang are right in not classing this as a narrowing conversion. The initialisation in question is that of a foo object. Its constructor argument is enclosed in {}. There cannot b...
test-img

n. m.

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