Category "templates"

Is there any way to control optimization of a template function in visual studio c++ 2017

I tried using #pragma optimize("", off) to selectively disable optimizations for the a() function. This does not work. Is there any way to control optimization

How to include images in xhtml2pdf generated pdf files?

I am running a streamlit app which generates reports containing images and dataframes. I have used jinja2 to generate the html file from a template. Then, I wou

Template of multiple abstract classes

There are many questions about template specialization with abstract classes, still I couldn't find something that helped me solve my problem. First of all, let

Returning a struct pointer from class method

EDIT: Changed example code to code from my project that doesn't work. I'm writing code in C++, learning templates and got stuck with some problem. There's a cla

Template partial ordering - why does partial deduction succeed here

Consider the following simple (to the extent that template questions ever are) example: #include <iostream> template <typename T> struct identity;

best practices in structuring jinja templates (flask)

I wrote a site in bootstrap and thinking about refactoring it in jinja. I am not much familiar with nesting blocks, and the site is relatively simple. My goal i

C++ : How to create a copy constructor of array that has a pointer?

I have template <class T> class arrList: public linearList<T> { public: arrList() {} arrList(const arrList<T>& List); ~

Unable to get the value from the drop down from html to python program in flask

I fetch the data from Mysql and populate the values to my html form in a drop down menu.Once the user selects the option, the value which gets sent back is only

Use templates to implement a subset of multiple virtual methods of a templated class

I am working on incorporating a new implementation based on an older, fixed API and moving in somewhat contradicting terrain because I need to pair a templated

C++ unpack variadic template arguments with the next function returns nothing [duplicate]

I'm trying to expand arguments to a variadic function. Code below works perfectly fine template<typename T> int printMy (const T& f)

Emulating Polymorphism without virtual pointers/overhead

Before reading I must emphasise I have demanding performance requirements (not premature optimization- processing millions of messages and need to design with p

Why does an optional argument in a template constructor for enable_if help the compiler to deduce the template parameter? [duplicate]

The minimal example is rather short: #include <iostream> #include <array> #include <type_traits> struct Foo{ //template

Covariant return type on Eigen Matrix for base class method

Suppose that I have two different solvers that both will be called at run time. I want to call solvers' api and get resulted Eigen matrix through the base class

couldn't find file 'owl.theme.default' with type 'text/css' error in rails 5.1.4

im getting the below error. Sprockets::FileNotFound at / couldn't find file 'owl.theme.default' with type 'text/css' Checked in these paths: /home/xyz/abc/pr

How to create a "factory function" for a templated class?

How would someone go about implementing a factory function for a templated class? Either my google searches aren't looking for the right thing, or I am misunde

How to send an email with variables using Mailjet API v3.1?

I just want to know why when I send variables using a template, the Mailjet API doesn't replace them, even the fakeFirstname doesn't show. I just see {{var:Firs

Is there a way to convert handlebars syntax to the golang template language?

Is there a safe way to easily convert standard handlebars templating syntax to the templating syntax used in golang(e.g. {{.Lookup "Question"}})? I have a Jenki

error: new initializer expression list treated as compound expression [-fpermissive]

I am trying to write a playlist method for songs in c++, however, I keep running into frequent errors. template <typename T> struct cir_list_node {

Ambiguous partial specializations and enable_if_t

This question is due to insane curiosity rather than an actual problem. Consider the following code: template<typename...> struct type_list {}; template&

Variadic template packed argument to std::vector

I'm new to templates and I don't really undestand why this doesn't work. I expected the vector to be constructed with those values. main.cpp template <typ