Skip to main content
Filter by
Sorted by
Tagged with
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
3 votes
0 answers
42 views

I am writing a cryptographic program for my bachelor's. I've been uzing an mpz_t variable for exponentiation with the PBC library. Currently, to avoid running mpz_init on every exponentiation, I only ...
nazar's user avatar
  • 31
0 votes
0 answers
63 views

The problem is I do want to define a function thats must be inline but I can't define it in the .c file of library becouse it's only be inline for in own file of library. Where should I declare my ...
user avatar
0 votes
1 answer
58 views

Considering the following function body: fn update_acc(&mut self, acc_rub: &Vector3<f32>, _t: u64) -> () { let acc = Self::rub_to_frd(acc_rub); if acc.norm() <...
tribbloid's user avatar
  • 3,832
0 votes
1 answer
104 views

I'm assigned to review and renew an old private library, which contains tons of do { .. } while(0) macros. After some investigations, I decided to replace them with static inline functions. After some ...
Qiuye-Hua's user avatar
3 votes
0 answers
122 views

inline bool mycmp(int i, int j) { return (i < j); } class mycmp2 { public: bool operator()(int i, int j) { return (i < j); } }; above is my example. I want know why the ...
xf h's user avatar
  • 39
2 votes
2 answers
181 views

I have a strange error concerning the inline keyword, this is just a sample code I wrote: #include <stdio.h> #include <stdint.h> uint8_t inline LIB_MATH_BTT_u8GetMSBSetBitPos(uint32_t ...
abdo Salm's user avatar
  • 1,923
0 votes
1 answer
52 views

I am trying to set up a class for representing 2-3D vectors. It's a template class that takes in a Coord type (integral/flaoting point representation of coordinates) and Dim (number of dimensions) as ...
Chimess's user avatar
  • 25
-1 votes
2 answers
338 views

#define INLINE static inline __attribute__((always_inline)) INLINE void swap(int a, int b){ int tmp = a; a = b; b = tmp; } int main(){ int x = 10; int y = 20; swap(x, y); ...
kaan's user avatar
  • 117
0 votes
0 answers
134 views

So I've got a rendering engine where in certain applications, it makes sense to use a vertex buffer, while in other applications it makes sense to use a triangle buffer. I'll briefly explain the ...
Chris Gnam's user avatar
6 votes
3 answers
828 views

On the cppreference page for the inline specifier, it says, The inline specifier, when used in a function's decl-specifier-seq, declares the function to be an inline function. An inline function has ...
Sourav Kannantha B's user avatar
1 vote
0 answers
63 views

I recently root caused a linking problem in our build after upgrading googletest from 1.8.1 to 1.12.1. Specifically, the problem occurs because we use -fkeep-inline-functions when gcov is enabled and ...
MarkB's user avatar
  • 2,230
0 votes
1 answer
48 views

• The function will be inline; that is, the compiler will try to generate code for the function at each point of call rather than using function-call instructions to use common code. This can be a ...
DJPillu's user avatar
2 votes
0 answers
87 views

Hello I know that if the compiler inlines a function, it replaces its body (statements) in each call to it. I've read this from Stroustrup's programming principles and practice using c++ about ...
Maestro's user avatar
  • 2,572
1 vote
1 answer
210 views

I write a small program to encounter the next day by giving day. I write a program in day_enum.cpp file:- #include <ostream> #include "AllHeader.h" using namespace std; inline days ...
Sangita Paul's user avatar
0 votes
2 answers
212 views

Say you have a View that selects a couple properties from a table. One of them is an inline function. After the view is created, will it execute the inline function if I don't select that property ...
Travis Peterson's user avatar
0 votes
2 answers
537 views

Oracle 18c: What is the syntax for including multiple inline functions and multiple CTEs in a WITH clause in a single query? Function #1: function fucntion1(num in number) return number is begin ...
User1974's user avatar
  • 366
5 votes
3 answers
1k views

I have this code: // my.h #ifndef MY_HEADER #define MY_HEADER int create_uid(); #endif // my.cpp #include "my.h" static int _next_uid = 0; int create_uid() { return _next_uid++; } ...
Narann's user avatar
  • 877
0 votes
1 answer
248 views

I'm having problem compiling cpp file with C inline functions using g++11. Following is an example: c.h: #ifndef C_H #define C_H #ifdef __cplusplus extern "C" { #endif inline int add(int a,...
Jackoo's user avatar
  • 533
0 votes
0 answers
133 views

I know, the question of passing scalars by value vs. by reference has been asked and answered gazillion times before, and I know - in general - they should be passed by value. But what about inline ...
Attila Fenyvesi's user avatar
2 votes
1 answer
507 views

I have hit a problem with SQL Server that results in it infinitely recompiling a function. To reproduce, create a new database with the option Parameterization = Forced or execute the following on an ...
Chuck's user avatar
  • 21
5 votes
1 answer
902 views

By analyzing code using SonarLint, I got a message (the title of the question) about a destructor that is declared like below: class Foo { public: . // default ctor . // parameterized ctor . ...
digito_evo's user avatar
  • 3,735
1 vote
1 answer
624 views

I am looking to convert an inline function of the following signature to a non-inline function const onMouseEnter = (itemName: string): void => { alert(itemName); }; I tried doing as follows but ...
LearnToImprove's user avatar
3 votes
1 answer
284 views

The Kotlin documentation itself states the following: If an inline function has no inlinable function parameters and no reified type parameters, the compiler will issue a warning, since inlining such ...
Markus Weninger's user avatar
3 votes
1 answer
211 views

If a function is static inline, inline here works only as a suggestion. With either static or static inline the function has internal linkage, and the compiler knows this function cannot be called ...
user avatar
0 votes
1 answer
287 views

This code generates a React error 301: https://reactjs.org/docs/error-decoder.html/?invariant=301 const [count, setCount] = useState(0) return <> <p>{count}</p> <button ...
Ayo Reis's user avatar
  • 651
1 vote
1 answer
1k views

I am trying to access one header file in multiple C++ files. The header file is defined as follows: #ifndef UTILS #define UTILS void toUpper(string &str) { for(unsigned int i=0; i<str....
InputBlackBoxOutput's user avatar
2 votes
1 answer
771 views

In a COTS system, I am able to enter a SQL WHERE clause. Example of WHERE clauses that work: worktype = 'Corrective Maintenance' or 1 = ( with cte as (select 1 as calc from dual) ...
User1974's user avatar
  • 366
0 votes
2 answers
1k views

I have hit a wall with this one and I can't find any question with a solution for this here in SO. I am using a PagingAdapter method, from Google's Paging library, that receives an inline function as ...
Shadow's user avatar
  • 4,889
0 votes
1 answer
183 views

gcc (Ubuntu 9.3.0-17ubuntu1~20.04) 9.3.0 I'm experimenting with inline and external definitions and here are 2 source files linked together: foo.c: #include <stdio.h> void foo(void){ ...
Some Name's user avatar
  • 9,750
1 vote
1 answer
426 views

I have a newbie question that is probably really easily explained. I have an image that has an onClick property added to it. If I call an inline function to log something, it works as expected. It ...
Justin Oberle's user avatar
1 vote
1 answer
210 views

I have a collection of items. And each item has another collection inside. To transform the first collection I'm using mapNotNull. I'm trying to achive something like this: data class QuestionData( ...
fcarg's user avatar
  • 11
0 votes
1 answer
953 views

I have an inline function which result I need multiple times during a T-SQL script execution. The results from the function are quite large. I am trying to figure out how to call the function only ...
Wilmar's user avatar
  • 568
0 votes
1 answer
5k views

I have installed raylib and ran the example .c files with success in VSCode and Notepad++. I'm trying to execute the files from this repo raylib-cpp/projects/CMake I haven't changed the files from ...
llsanketll's user avatar
0 votes
1 answer
218 views

I've been trying to figure out a fastest way to change vector of bytes to 64bit integer, This is a code I've used for benchmarking #include <iostream> #include <ctime> #include <ratio&...
Daniel Nowak's user avatar
-1 votes
1 answer
478 views

I am following an online tutorial which is quite similar to my code, but not exactly the same. I have modified it so that I can have a better understanding of it, but I am having problems getting/...
Apachi's user avatar
  • 11
5 votes
1 answer
4k views

I am new to dart and flutter, I am trying to use an inline function to return a value. SizedBox( height: _getheight() ), double _getheight(){ //do some stuff return 20.0; } //WORKS SizedBox( ...
ryan 's user avatar
  • 53
0 votes
1 answer
500 views

From reading the standard I was unable to figure out if the following code violates ODR: // a.h #ifndef A_HEADER_FILE #define A_HEADER_FILE namespace { int v; } inline int get_v() { return v; } #...
PYA's user avatar
  • 8,812
2 votes
1 answer
231 views

I am learning C++ and currently testing inline functions. If I run my code now I will have linking error, but if I change inline void Test::print40() to void Test::print40() everything would be fine. ...
Denys_newbie's user avatar
  • 1,160
2 votes
2 answers
825 views

I have a header file where string are defined as static global. namespace space { #define NAME(P) static std::string const s_##P = #P NAME(foo); NAME(bar); //... other values #undef NAME } ...
Michael Doubez's user avatar
-1 votes
1 answer
46 views

I'm studying about Kotlin's inline function just after Kotiln's lambda,,, below code is about Kotlin's inline function example I know that "return" can't be in lambda in Kotlin But What is a "...
위에서아래를's user avatar
1 vote
1 answer
72 views

As far as i know, inline functions in C work pretty the same way as in C++ when used in single translation unit and there's no need to dive into extern inline difficulties in such a case. However, the ...
qrort's user avatar
  • 13
1 vote
1 answer
233 views

As specified in the Standard If the declaration of an identifier for a function has no storage-class specifier, its linkage is determined exactly as if it were declared with the storage-class ...
St.Antario's user avatar
  • 27.8k
1 vote
2 answers
2k views

#include <iostream> #include <functional> int main(){ int a = 10; std::function<int(int)> functionPointer = [a](int a)-> int{ return a + a + 100 ; }; int returnValue =...
Rohit Bakoliya's user avatar
1 vote
1 answer
215 views

I was reading the source code of OS/161 and encountered inline support code. I am not able to understand the comment provided. The comment is :- /* ...
Daksh Pratap Singh's user avatar
2 votes
1 answer
1k views

I have the requirement to call my 2nd inline function into my 1st function. I am not able to achieve this one and getting error only. with function add_string(p_string in varchar2) return ...
Deenadhayalan M's user avatar
2 votes
1 answer
790 views

So I realize that when including a ".h" file, the compiler essentially copies the contents of that file to the point it was included. So obviously if I had "Utils.h" included in many files, if utils.h ...
Hex Crown's user avatar
  • 763
-1 votes
1 answer
203 views

I was reading about inline functions and how they could have multiple definitions in different Translation Units but those definitions must be the same. So what I was thinking is that if I declared ...
Blood-HaZaRd's user avatar
  • 2,138
1 vote
2 answers
620 views

To make a function inline should I add the keyword inline in function prototype or in function definition or should I add the inline keyword both in function declaration and function definition.
play store's user avatar
1 vote
2 answers
1k views

There is a constraint 6.7.4(p3): An inline definition of a function with external linkage shall not contain a definition of a modifiable object with static or thread storage duration, and shall ...
Some Name's user avatar
  • 9,750