Skip to main content
Filter by
Sorted by
Tagged with
3 votes
1 answer
123 views

Consider the following translation unit: export module Example; export inline void fn1(); export void fn2(); export void fn3(); void fn1() {} void fn2() {} module :private; void fn3() {} Firstly, ...
Tristan Brindle's user avatar
Best practices
1 vote
8 replies
192 views

Say I'm developing a C++ command line tool of moderate scope. I have a couple dozen classes, and a main() driver function that lets the user do a few things with the tool. I could have one .hpp and ...
interfect's user avatar
  • 3,017
Advice
2 votes
7 replies
126 views

I know that it's possible to take the address of an inline function, just like with ordinary functions. But if each translation unit has its own inline definition, and I take the address of the ...
Morel's user avatar
  • 1
4 votes
1 answer
99 views

Looking at this benchmark about a custom std::function implementation: https://github.com/PacktPublishing/Hands-On-Design-Patterns-with-CPP-Second-Edition/blob/main/Chapter06/09_function.C I tried to ...
luczzz's user avatar
  • 446
0 votes
0 answers
31 views

My chat bubbles leave a large empty space on the right when messages wrap into multiple lines. I want the behavior like iMessage/WhatsApp: Bubble shrinks to fit short text. Long messages use max ...
Manou K's user avatar
4 votes
2 answers
244 views

It is a common statement that compilers take the final decision about inlining. But what if the developer is sure that in a certain place function inline is definitely good? For example, imagine a ...
Rafael Santiago Altoé's user avatar
3 votes
1 answer
106 views

I've seen something like that in a C-code and I'm wondering what it exactly does: file.h int f(int x); file.c inline int f(int x) { ... } Basically the function is declared as inline in the C-...
Kevin Meier's user avatar
  • 2,644
5 votes
1 answer
148 views

In the C++20 draft (N4868) there are two relevant rules about definition reachability: Inline functions must have their definition reachable in every translation unit in which they are ODR-used: [...
klezki's user avatar
  • 197
6 votes
1 answer
119 views

Even though this might look like duplication, I'd claim that it isn't. Why does a compiler make the Foo function, which is defined in foo.c as inline double Foo() { return 1.2; }, a global function if ...
Stephen's user avatar
  • 735
4 votes
2 answers
146 views

Is there any use of exported inline variables in c++20 modules? Is there any difference between export constexpr auto val1 = 0; export const auto val2 = 0; export auto val3 = 0; and export inline ...
Martin Fehrs's user avatar
  • 1,185
0 votes
1 answer
193 views

I'm intresed how and in what cases V8 perform inlining. I know that V8 can inline functions to eliminate call cost, but i dont konw the rules for it to happen. I got how it works in obvious cases, ...
vanilla's user avatar
  • 145
0 votes
2 answers
61 views

I suspect the answer to this question is simply that it's not possible, but thought I would ask in case I've missed something. I am a teacher using the Canvas LMS (instructure). I can code, I have an ...
HapaxHypatia's user avatar
0 votes
0 answers
58 views

I’m writing a library that generates Java code at runtime, and so far it’s producing good results. The problem: some legacy software (read: "adopting polymorphism now is kinda impossible") ...
Vento's user avatar
  • 91
13 votes
1 answer
368 views

I'm was reading through parts of Rust's standard library as inspiration for a library I'm working on. I noticed that many functions are marked #[inline] despite them being generic. Here's a few ...
ChrisB's user avatar
  • 4,156
1 vote
1 answer
156 views

In a scala 3.6.4 serialization library I am developing there is the DiscriminatorCriteria type-class that allows the user to determine which discriminator value to use for each variant P of a sum-type ...
Readren's user avatar
  • 1,290
15 votes
2 answers
809 views

I'm encountering unexpected behavior on MSVC when storing a pointer to a virtual method in a static inline variable. The issue does not occur on GCC or Clang. Specifically, when I store a pointer to a ...
Artem Selivanov's user avatar
0 votes
0 answers
107 views

Python 3.13.2, pyTelegramBotAPI-4.27.0, Windows 10 I have a problem with Python telebot inline buttons. It worked fine for a long time, without any problems. At some point it stopped to work. I did ...
John Smith's user avatar
0 votes
2 answers
120 views

The goal of the assignment was to initialize an empty list called rand_array then fill it with 10 unique random numbers I figured out the assignment normally as per the teacher's directions: import ...
egg-kun's user avatar
  • 13
3 votes
1 answer
108 views

// lib.h #pragma once static inline int static_inline(int x) { return x; } inline int extern_inline(int x) { return static_inline(x); } // lib.c #include "lib.h" extern inline int ...
Jackoo's user avatar
  • 533
0 votes
1 answer
211 views

I have an instance variable or property called Setting that is shared among threads. A new instance will occasionally be assigned to this variable by other threads. The method using the Setting will ...
user's user avatar
  • 31
2 votes
1 answer
175 views

Note: the same question I've asked but for C++ is answered here: Will removal of all `inline` keywords for functions and methods leave my program semantically correct? . Given that C is a related but ...
Grigory Rechistov's user avatar
0 votes
0 answers
61 views

I am tryilng to save attachments from emails using MailKit. I have emails with attachments, which are not seen by MailKit. When these messages are opened in Outlook I see that they have attachments. I ...
KiNest's user avatar
  • 65
6 votes
3 answers
276 views

Inspired by the article "Why const Doesn't Make C Code Faster", I want to carry out a similar experiment in my code base, but for inline. I have a feeling that a lot of code currently marked ...
Grigory Rechistov's user avatar
0 votes
0 answers
29 views

Is there a way to keep Jodit's inline toolbar open (if there's selected text) after a choice is made from the toolbar? If not, is there a way to auto-open the inline toolbar if currently there's ...
Andrew Foulds's user avatar
0 votes
1 answer
500 views

I am trying to use an inline regular expression in a koa-router route parameter, but I am getting an error. Here’s my code: import Koa from 'koa'; import Router from 'koa-router'; const app = new Koa(...
ButteryAvocado's user avatar
0 votes
1 answer
86 views

While I tried to understand inline functions, I found myself in a rabbit hole which is very deep. I get to know that inline is a function specifier, that inline is a mere hint to a compiler, that it's ...
Doohyeon Won's user avatar
2 votes
0 answers
101 views

I have some C code with a header and source file (with development dating back probably about 15 years). I have some questions about function inlining, which I know only provides a "hint" to ...
Lance E.T. Compte's user avatar
1 vote
1 answer
85 views

Here what this problem looks like: typedef uint32_t StrTableKey_t; typedef struct StrTableEntry_s { char *string; StrTableKey_t keyhash, keyid; size_t usages; } StrTableEntry_t; typedef ...
magg's user avatar
  • 65
0 votes
0 answers
67 views

If tried to do a asm("push eax;"), but it did not work. asm ("push ax;") and asm("push rax;") work fine. Any suggestions?
Christian Reinbothe's user avatar
1 vote
1 answer
227 views

I've been learning about inline static variables in C++17 and their initialization across multiple translation units. I understand that inline static variables are introduced to maintain a single ...
sam's user avatar
  • 911
1 vote
1 answer
239 views

Is it possible instead of using an extra time/date component to pop up modal date / time component to have it inline and act the same way? Currently the only option I see is as below, where calendar ...
kos's user avatar
  • 1,397
-1 votes
1 answer
136 views

It's supposed to be, according to info I've heard, that if you have a variable such as: inline int a_var; or struct Foo { static inline int a_var; }; In a header file and include that header ...
Zebrafish's user avatar
  • 16.5k
-1 votes
1 answer
195 views

I'm having trouble figuring how to add an inline element by the end of a text block using a line-clamp. The element could be a tag or a hoverable icon in order to display a tooltip. As I need to use ...
Oddrigue's user avatar
  • 582
0 votes
0 answers
125 views

Is there ever a reason to explicitly inline a constexpr variable that's in an unnamed namespace in a source file? E.g. in a foo.cc: namespace foo { namespace { inline constexpr uint32_t kFoo = 0; } //...
Matt Stokes's user avatar
  • 5,068
0 votes
0 answers
80 views

#include <stdio.h> inline int b(int x) { return x*2; }; int main() { printf("Hello World %d", b(3)); return 0; } Output: /usr/bin/ld: /tmp/ccGGQWnl.o: in function 'main'...
Xfce4's user avatar
  • 577
0 votes
1 answer
187 views

Not sure, why, tried disabling all extensions to check, and checked in preferences, but as of this morning my Vue 3 component has underlines for classes, regardless of color theme. Like so: Any ...
Thomas James Thorstensson's user avatar
1 vote
4 answers
161 views

Supposing I have a function foo() and an inline function bar(): inline void bar(void) { // do some stuff } void foo(void) { // some code bar(); } Is the C compiler allowed to rearrange /...
Andres Lantschner's user avatar
1 vote
0 answers
142 views

Could you tell me how I can make the DatePicker.ReactPicker dropdown panel with calendars display inline? i.e. it is necessary that the dropdown calendar is drawn at once and the parent window reacts ...
Zhihar's user avatar
  • 1,448
1 vote
1 answer
76 views

I want to inline a function using PRAGMA INLINE but I am not sure how to check if it worked as I expect. More exactly, I have a function: create or replace function my_fnc(p1 varchar2, p2 varchar2) ...
mikcutu's user avatar
  • 1,102
0 votes
1 answer
160 views

Is it possible to have this in Delphi? DoThis(ShowMessage('SomeMsg ..'); Caption := 'SomeCaption'; Inc(I)); Is it possible to create a new type that handles inline code like this? For example, we ...
MBen's user avatar
  • 21
1 vote
0 answers
111 views

(IMO) Cons when not inlined: call is unconditional branch (jump) with stack manipulation, and the x86 instruction table specifies it needs 4 uops/inst. and has reciprocal throughput of 2 for Zen4 ...
hurryman2212's user avatar
2 votes
1 answer
145 views

I'm trying to put together a powershell script that we can use for some custom scripts to a commercial IT monitoring solution (StableNet by Infosim.de). The product has a neat feature on passing on ...
ThomasN's user avatar
  • 23
3 votes
0 answers
128 views

I'm trying to create a structure that's essentially just a regular double but has a physical unit attached via generics. My attempts perform terribly, even without generics. Could somebody give me ...
Bananach's user avatar
  • 2,370
0 votes
0 answers
50 views

HiALL I am using MDK arm compiler (No optimization) on stm32f030 chip. I noticed that function declared with __forceinline takes more time to execute that without that. I checked that with ...
zulunation's user avatar
0 votes
1 answer
111 views

There are two possible ways to define shared inline functions: 1st form, extern inline main.c: #include <stdio.h> #include "main.h" #include "file1.h" extern inline int f(...
Rubem Pacelli's user avatar
1 vote
1 answer
511 views

I want to use inline function across multiple C files. Maybe the MWE would be: main.c: #include <stdio.h> #include "main.h" #include "file1.h" // Define the inline function ...
Rubem Pacelli's user avatar
2 votes
0 answers
61 views

TL;DR: How do I fix* inline failures by LTO on compiler-generated functions? (* by "fix" I mean "eliminate warnings in a manner consistent with best practice." I want to remove the ...
mrp's user avatar
  • 71
3 votes
1 answer
101 views

I have written the util class to be used with Flow<> in kotlin. The goal of the class is to simplify error handling and make possible to instantly finish the flow by calling breakFlow() method. ...
K0cur's user avatar
  • 120
0 votes
1 answer
90 views

I was wondering if it's possible to change the color of a SVG image/icon/logo in an inline html <img> tag, using style="..." Here's part of my code, it's a button and I want the logo (...
Karla Cossío's user avatar
0 votes
1 answer
63 views

I am implementing CSP in my application and the browser says CSP has been violated in the following: 1. jquery.min.js: Inline style violation in the following line t.insertBefore(e, t.firstChild) 2. ...
DeshBhakt's user avatar
  • 157

1
2 3 4 5
77